1 /* 2 * Copyright 2022 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.cloud.compute.v1; 18 19 import static com.google.cloud.compute.v1.InterconnectAttachmentsClient.AggregatedListPagedResponse; 20 import static com.google.cloud.compute.v1.InterconnectAttachmentsClient.ListPagedResponse; 21 22 import com.google.api.core.ApiFunction; 23 import com.google.api.core.BetaApi; 24 import com.google.api.gax.core.GoogleCredentialsProvider; 25 import com.google.api.gax.core.InstantiatingExecutorProvider; 26 import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; 27 import com.google.api.gax.rpc.ApiClientHeaderProvider; 28 import com.google.api.gax.rpc.ClientContext; 29 import com.google.api.gax.rpc.ClientSettings; 30 import com.google.api.gax.rpc.OperationCallSettings; 31 import com.google.api.gax.rpc.PagedCallSettings; 32 import com.google.api.gax.rpc.TransportChannelProvider; 33 import com.google.api.gax.rpc.UnaryCallSettings; 34 import com.google.cloud.compute.v1.stub.InterconnectAttachmentsStubSettings; 35 import java.io.IOException; 36 import java.util.List; 37 import javax.annotation.Generated; 38 39 // AUTO-GENERATED DOCUMENTATION AND CLASS. 40 /** 41 * Settings class to configure an instance of {@link InterconnectAttachmentsClient}. 42 * 43 * <p>The default instance has everything set to sensible defaults: 44 * 45 * <ul> 46 * <li>The default service address (compute.googleapis.com) and default port (443) are used. 47 * <li>Credentials are acquired automatically through Application Default Credentials. 48 * <li>Retries are configured for idempotent methods but not for non-idempotent methods. 49 * </ul> 50 * 51 * <p>The builder of this class is recursive, so contained classes are themselves builders. When 52 * build() is called, the tree of builders is called to create the complete settings object. 53 * 54 * <p>For example, to set the total timeout of get to 30 seconds: 55 * 56 * <pre>{@code 57 * // This snippet has been automatically generated and should be regarded as a code template only. 58 * // It will require modifications to work: 59 * // - It may require correct/in-range values for request initialization. 60 * // - It may require specifying regional endpoints when creating the service client as shown in 61 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library 62 * InterconnectAttachmentsSettings.Builder interconnectAttachmentsSettingsBuilder = 63 * InterconnectAttachmentsSettings.newBuilder(); 64 * interconnectAttachmentsSettingsBuilder 65 * .getSettings() 66 * .setRetrySettings( 67 * interconnectAttachmentsSettingsBuilder 68 * .getSettings() 69 * .getRetrySettings() 70 * .toBuilder() 71 * .setTotalTimeout(Duration.ofSeconds(30)) 72 * .build()); 73 * InterconnectAttachmentsSettings interconnectAttachmentsSettings = 74 * interconnectAttachmentsSettingsBuilder.build(); 75 * }</pre> 76 */ 77 @Generated("by gapic-generator-java") 78 public class InterconnectAttachmentsSettings 79 extends ClientSettings<InterconnectAttachmentsSettings> { 80 81 /** Returns the object with the settings used for calls to aggregatedList. */ 82 public PagedCallSettings< 83 AggregatedListInterconnectAttachmentsRequest, 84 InterconnectAttachmentAggregatedList, 85 AggregatedListPagedResponse> aggregatedListSettings()86 aggregatedListSettings() { 87 return ((InterconnectAttachmentsStubSettings) getStubSettings()).aggregatedListSettings(); 88 } 89 90 /** Returns the object with the settings used for calls to delete. */ deleteSettings()91 public UnaryCallSettings<DeleteInterconnectAttachmentRequest, Operation> deleteSettings() { 92 return ((InterconnectAttachmentsStubSettings) getStubSettings()).deleteSettings(); 93 } 94 95 /** Returns the object with the settings used for calls to delete. */ 96 public OperationCallSettings<DeleteInterconnectAttachmentRequest, Operation, Operation> deleteOperationSettings()97 deleteOperationSettings() { 98 return ((InterconnectAttachmentsStubSettings) getStubSettings()).deleteOperationSettings(); 99 } 100 101 /** Returns the object with the settings used for calls to get. */ getSettings()102 public UnaryCallSettings<GetInterconnectAttachmentRequest, InterconnectAttachment> getSettings() { 103 return ((InterconnectAttachmentsStubSettings) getStubSettings()).getSettings(); 104 } 105 106 /** Returns the object with the settings used for calls to insert. */ insertSettings()107 public UnaryCallSettings<InsertInterconnectAttachmentRequest, Operation> insertSettings() { 108 return ((InterconnectAttachmentsStubSettings) getStubSettings()).insertSettings(); 109 } 110 111 /** Returns the object with the settings used for calls to insert. */ 112 public OperationCallSettings<InsertInterconnectAttachmentRequest, Operation, Operation> insertOperationSettings()113 insertOperationSettings() { 114 return ((InterconnectAttachmentsStubSettings) getStubSettings()).insertOperationSettings(); 115 } 116 117 /** Returns the object with the settings used for calls to list. */ 118 public PagedCallSettings< 119 ListInterconnectAttachmentsRequest, InterconnectAttachmentList, ListPagedResponse> listSettings()120 listSettings() { 121 return ((InterconnectAttachmentsStubSettings) getStubSettings()).listSettings(); 122 } 123 124 /** Returns the object with the settings used for calls to patch. */ patchSettings()125 public UnaryCallSettings<PatchInterconnectAttachmentRequest, Operation> patchSettings() { 126 return ((InterconnectAttachmentsStubSettings) getStubSettings()).patchSettings(); 127 } 128 129 /** Returns the object with the settings used for calls to patch. */ 130 public OperationCallSettings<PatchInterconnectAttachmentRequest, Operation, Operation> patchOperationSettings()131 patchOperationSettings() { 132 return ((InterconnectAttachmentsStubSettings) getStubSettings()).patchOperationSettings(); 133 } 134 135 /** Returns the object with the settings used for calls to setLabels. */ setLabelsSettings()136 public UnaryCallSettings<SetLabelsInterconnectAttachmentRequest, Operation> setLabelsSettings() { 137 return ((InterconnectAttachmentsStubSettings) getStubSettings()).setLabelsSettings(); 138 } 139 140 /** Returns the object with the settings used for calls to setLabels. */ 141 public OperationCallSettings<SetLabelsInterconnectAttachmentRequest, Operation, Operation> setLabelsOperationSettings()142 setLabelsOperationSettings() { 143 return ((InterconnectAttachmentsStubSettings) getStubSettings()).setLabelsOperationSettings(); 144 } 145 create( InterconnectAttachmentsStubSettings stub)146 public static final InterconnectAttachmentsSettings create( 147 InterconnectAttachmentsStubSettings stub) throws IOException { 148 return new InterconnectAttachmentsSettings.Builder(stub.toBuilder()).build(); 149 } 150 151 /** Returns a builder for the default ExecutorProvider for this service. */ defaultExecutorProviderBuilder()152 public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { 153 return InterconnectAttachmentsStubSettings.defaultExecutorProviderBuilder(); 154 } 155 156 /** Returns the default service endpoint. */ getDefaultEndpoint()157 public static String getDefaultEndpoint() { 158 return InterconnectAttachmentsStubSettings.getDefaultEndpoint(); 159 } 160 161 /** Returns the default service scopes. */ getDefaultServiceScopes()162 public static List<String> getDefaultServiceScopes() { 163 return InterconnectAttachmentsStubSettings.getDefaultServiceScopes(); 164 } 165 166 /** Returns a builder for the default credentials for this service. */ defaultCredentialsProviderBuilder()167 public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { 168 return InterconnectAttachmentsStubSettings.defaultCredentialsProviderBuilder(); 169 } 170 171 /** Returns a builder for the default ChannelProvider for this service. */ 172 public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()173 defaultHttpJsonTransportProviderBuilder() { 174 return InterconnectAttachmentsStubSettings.defaultHttpJsonTransportProviderBuilder(); 175 } 176 defaultTransportChannelProvider()177 public static TransportChannelProvider defaultTransportChannelProvider() { 178 return InterconnectAttachmentsStubSettings.defaultTransportChannelProvider(); 179 } 180 181 @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") defaultApiClientHeaderProviderBuilder()182 public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { 183 return InterconnectAttachmentsStubSettings.defaultApiClientHeaderProviderBuilder(); 184 } 185 186 /** Returns a new builder for this class. */ newBuilder()187 public static Builder newBuilder() { 188 return Builder.createDefault(); 189 } 190 191 /** Returns a new builder for this class. */ newBuilder(ClientContext clientContext)192 public static Builder newBuilder(ClientContext clientContext) { 193 return new Builder(clientContext); 194 } 195 196 /** Returns a builder containing all the values of this settings class. */ toBuilder()197 public Builder toBuilder() { 198 return new Builder(this); 199 } 200 InterconnectAttachmentsSettings(Builder settingsBuilder)201 protected InterconnectAttachmentsSettings(Builder settingsBuilder) throws IOException { 202 super(settingsBuilder); 203 } 204 205 /** Builder for InterconnectAttachmentsSettings. */ 206 public static class Builder 207 extends ClientSettings.Builder<InterconnectAttachmentsSettings, Builder> { 208 Builder()209 protected Builder() throws IOException { 210 this(((ClientContext) null)); 211 } 212 Builder(ClientContext clientContext)213 protected Builder(ClientContext clientContext) { 214 super(InterconnectAttachmentsStubSettings.newBuilder(clientContext)); 215 } 216 Builder(InterconnectAttachmentsSettings settings)217 protected Builder(InterconnectAttachmentsSettings settings) { 218 super(settings.getStubSettings().toBuilder()); 219 } 220 Builder(InterconnectAttachmentsStubSettings.Builder stubSettings)221 protected Builder(InterconnectAttachmentsStubSettings.Builder stubSettings) { 222 super(stubSettings); 223 } 224 createDefault()225 private static Builder createDefault() { 226 return new Builder(InterconnectAttachmentsStubSettings.newBuilder()); 227 } 228 getStubSettingsBuilder()229 public InterconnectAttachmentsStubSettings.Builder getStubSettingsBuilder() { 230 return ((InterconnectAttachmentsStubSettings.Builder) getStubSettings()); 231 } 232 233 /** 234 * Applies the given settings updater function to all of the unary API methods in this service. 235 * 236 * <p>Note: This method does not support applying settings to streaming methods. 237 */ applyToAllUnaryMethods( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater)238 public Builder applyToAllUnaryMethods( 239 ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { 240 super.applyToAllUnaryMethods( 241 getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); 242 return this; 243 } 244 245 /** Returns the builder for the settings used for calls to aggregatedList. */ 246 public PagedCallSettings.Builder< 247 AggregatedListInterconnectAttachmentsRequest, 248 InterconnectAttachmentAggregatedList, 249 AggregatedListPagedResponse> aggregatedListSettings()250 aggregatedListSettings() { 251 return getStubSettingsBuilder().aggregatedListSettings(); 252 } 253 254 /** Returns the builder for the settings used for calls to delete. */ 255 public UnaryCallSettings.Builder<DeleteInterconnectAttachmentRequest, Operation> deleteSettings()256 deleteSettings() { 257 return getStubSettingsBuilder().deleteSettings(); 258 } 259 260 /** Returns the builder for the settings used for calls to delete. */ 261 public OperationCallSettings.Builder<DeleteInterconnectAttachmentRequest, Operation, Operation> deleteOperationSettings()262 deleteOperationSettings() { 263 return getStubSettingsBuilder().deleteOperationSettings(); 264 } 265 266 /** Returns the builder for the settings used for calls to get. */ 267 public UnaryCallSettings.Builder<GetInterconnectAttachmentRequest, InterconnectAttachment> getSettings()268 getSettings() { 269 return getStubSettingsBuilder().getSettings(); 270 } 271 272 /** Returns the builder for the settings used for calls to insert. */ 273 public UnaryCallSettings.Builder<InsertInterconnectAttachmentRequest, Operation> insertSettings()274 insertSettings() { 275 return getStubSettingsBuilder().insertSettings(); 276 } 277 278 /** Returns the builder for the settings used for calls to insert. */ 279 public OperationCallSettings.Builder<InsertInterconnectAttachmentRequest, Operation, Operation> insertOperationSettings()280 insertOperationSettings() { 281 return getStubSettingsBuilder().insertOperationSettings(); 282 } 283 284 /** Returns the builder for the settings used for calls to list. */ 285 public PagedCallSettings.Builder< 286 ListInterconnectAttachmentsRequest, InterconnectAttachmentList, ListPagedResponse> listSettings()287 listSettings() { 288 return getStubSettingsBuilder().listSettings(); 289 } 290 291 /** Returns the builder for the settings used for calls to patch. */ 292 public UnaryCallSettings.Builder<PatchInterconnectAttachmentRequest, Operation> patchSettings()293 patchSettings() { 294 return getStubSettingsBuilder().patchSettings(); 295 } 296 297 /** Returns the builder for the settings used for calls to patch. */ 298 public OperationCallSettings.Builder<PatchInterconnectAttachmentRequest, Operation, Operation> patchOperationSettings()299 patchOperationSettings() { 300 return getStubSettingsBuilder().patchOperationSettings(); 301 } 302 303 /** Returns the builder for the settings used for calls to setLabels. */ 304 public UnaryCallSettings.Builder<SetLabelsInterconnectAttachmentRequest, Operation> setLabelsSettings()305 setLabelsSettings() { 306 return getStubSettingsBuilder().setLabelsSettings(); 307 } 308 309 /** Returns the builder for the settings used for calls to setLabels. */ 310 public OperationCallSettings.Builder< 311 SetLabelsInterconnectAttachmentRequest, Operation, Operation> setLabelsOperationSettings()312 setLabelsOperationSettings() { 313 return getStubSettingsBuilder().setLabelsOperationSettings(); 314 } 315 316 @Override build()317 public InterconnectAttachmentsSettings build() throws IOException { 318 return new InterconnectAttachmentsSettings(this); 319 } 320 } 321 } 322