All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.baremetalsolution.v2.stub.BareMetalSolutionStubSettings Maven / Gradle / Ivy

Go to download

Bare Metal SOlution Bring your Oracle workloads to Google Cloud with Bare Metal Solution and jumpstart your cloud journey with minimal risk.

There is a newer version: 0.55.0
Show newest version
/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.baremetalsolution.v2.stub;

import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListInstancesPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListLunsPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListNetworksPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListNfsSharesPagedResponse;
import static com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient.ListVolumesPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
import com.google.api.gax.httpjson.GaxHttpJsonProperties;
import com.google.api.gax.httpjson.HttpJsonTransportChannel;
import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallSettings;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
import com.google.api.gax.rpc.PagedListResponseFactory;
import com.google.api.gax.rpc.StatusCode;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.baremetalsolution.v2.DetachLunRequest;
import com.google.cloud.baremetalsolution.v2.GetInstanceRequest;
import com.google.cloud.baremetalsolution.v2.GetLunRequest;
import com.google.cloud.baremetalsolution.v2.GetNetworkRequest;
import com.google.cloud.baremetalsolution.v2.GetNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.GetVolumeRequest;
import com.google.cloud.baremetalsolution.v2.Instance;
import com.google.cloud.baremetalsolution.v2.ListInstancesRequest;
import com.google.cloud.baremetalsolution.v2.ListInstancesResponse;
import com.google.cloud.baremetalsolution.v2.ListLunsRequest;
import com.google.cloud.baremetalsolution.v2.ListLunsResponse;
import com.google.cloud.baremetalsolution.v2.ListNetworkUsageRequest;
import com.google.cloud.baremetalsolution.v2.ListNetworkUsageResponse;
import com.google.cloud.baremetalsolution.v2.ListNetworksRequest;
import com.google.cloud.baremetalsolution.v2.ListNetworksResponse;
import com.google.cloud.baremetalsolution.v2.ListNfsSharesRequest;
import com.google.cloud.baremetalsolution.v2.ListNfsSharesResponse;
import com.google.cloud.baremetalsolution.v2.ListVolumesRequest;
import com.google.cloud.baremetalsolution.v2.ListVolumesResponse;
import com.google.cloud.baremetalsolution.v2.Lun;
import com.google.cloud.baremetalsolution.v2.Network;
import com.google.cloud.baremetalsolution.v2.NfsShare;
import com.google.cloud.baremetalsolution.v2.OperationMetadata;
import com.google.cloud.baremetalsolution.v2.ResetInstanceRequest;
import com.google.cloud.baremetalsolution.v2.ResetInstanceResponse;
import com.google.cloud.baremetalsolution.v2.ResizeVolumeRequest;
import com.google.cloud.baremetalsolution.v2.StartInstanceRequest;
import com.google.cloud.baremetalsolution.v2.StartInstanceResponse;
import com.google.cloud.baremetalsolution.v2.StopInstanceRequest;
import com.google.cloud.baremetalsolution.v2.StopInstanceResponse;
import com.google.cloud.baremetalsolution.v2.UpdateInstanceRequest;
import com.google.cloud.baremetalsolution.v2.UpdateNetworkRequest;
import com.google.cloud.baremetalsolution.v2.UpdateNfsShareRequest;
import com.google.cloud.baremetalsolution.v2.UpdateVolumeRequest;
import com.google.cloud.baremetalsolution.v2.Volume;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.longrunning.Operation;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;
import org.threeten.bp.Duration;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Settings class to configure an instance of {@link BareMetalSolutionStub}.
 *
 * 

The default instance has everything set to sensible defaults: * *

    *
  • The default service address (baremetalsolution.googleapis.com) and default port (443) are * used. *
  • Credentials are acquired automatically through Application Default Credentials. *
  • Retries are configured for idempotent methods but not for non-idempotent methods. *
* *

The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * *

For example, to set the total timeout of getInstance to 30 seconds: * *

{@code
 * // This snippet has been automatically generated and should be regarded as a code template only.
 * // It will require modifications to work:
 * // - It may require correct/in-range values for request initialization.
 * // - It may require specifying regional endpoints when creating the service client as shown in
 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 * BareMetalSolutionStubSettings.Builder bareMetalSolutionSettingsBuilder =
 *     BareMetalSolutionStubSettings.newBuilder();
 * bareMetalSolutionSettingsBuilder
 *     .getInstanceSettings()
 *     .setRetrySettings(
 *         bareMetalSolutionSettingsBuilder
 *             .getInstanceSettings()
 *             .getRetrySettings()
 *             .toBuilder()
 *             .setTotalTimeout(Duration.ofSeconds(30))
 *             .build());
 * BareMetalSolutionStubSettings bareMetalSolutionSettings =
 *     bareMetalSolutionSettingsBuilder.build();
 * }
*/ @Generated("by gapic-generator-java") public class BareMetalSolutionStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); private final PagedCallSettings< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> listInstancesSettings; private final UnaryCallSettings getInstanceSettings; private final UnaryCallSettings updateInstanceSettings; private final OperationCallSettings updateInstanceOperationSettings; private final UnaryCallSettings resetInstanceSettings; private final OperationCallSettings< ResetInstanceRequest, ResetInstanceResponse, OperationMetadata> resetInstanceOperationSettings; private final UnaryCallSettings startInstanceSettings; private final OperationCallSettings< StartInstanceRequest, StartInstanceResponse, OperationMetadata> startInstanceOperationSettings; private final UnaryCallSettings stopInstanceSettings; private final OperationCallSettings stopInstanceOperationSettings; private final UnaryCallSettings detachLunSettings; private final OperationCallSettings detachLunOperationSettings; private final PagedCallSettings listVolumesSettings; private final UnaryCallSettings getVolumeSettings; private final UnaryCallSettings updateVolumeSettings; private final OperationCallSettings updateVolumeOperationSettings; private final UnaryCallSettings resizeVolumeSettings; private final OperationCallSettings resizeVolumeOperationSettings; private final PagedCallSettings< ListNetworksRequest, ListNetworksResponse, ListNetworksPagedResponse> listNetworksSettings; private final UnaryCallSettings listNetworkUsageSettings; private final UnaryCallSettings getNetworkSettings; private final UnaryCallSettings updateNetworkSettings; private final OperationCallSettings updateNetworkOperationSettings; private final UnaryCallSettings getLunSettings; private final PagedCallSettings listLunsSettings; private final UnaryCallSettings getNfsShareSettings; private final PagedCallSettings< ListNfsSharesRequest, ListNfsSharesResponse, ListNfsSharesPagedResponse> listNfsSharesSettings; private final UnaryCallSettings updateNfsShareSettings; private final OperationCallSettings updateNfsShareOperationSettings; private static final PagedListDescriptor LIST_INSTANCES_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListInstancesRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListInstancesResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListInstancesResponse payload) { return payload.getInstancesList() == null ? ImmutableList.of() : payload.getInstancesList(); } }; private static final PagedListDescriptor LIST_VOLUMES_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListVolumesRequest injectToken(ListVolumesRequest payload, String token) { return ListVolumesRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListVolumesRequest injectPageSize(ListVolumesRequest payload, int pageSize) { return ListVolumesRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListVolumesRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListVolumesResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListVolumesResponse payload) { return payload.getVolumesList() == null ? ImmutableList.of() : payload.getVolumesList(); } }; private static final PagedListDescriptor LIST_NETWORKS_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListNetworksRequest injectToken(ListNetworksRequest payload, String token) { return ListNetworksRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListNetworksRequest injectPageSize(ListNetworksRequest payload, int pageSize) { return ListNetworksRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListNetworksRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListNetworksResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListNetworksResponse payload) { return payload.getNetworksList() == null ? ImmutableList.of() : payload.getNetworksList(); } }; private static final PagedListDescriptor LIST_LUNS_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListLunsRequest injectToken(ListLunsRequest payload, String token) { return ListLunsRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListLunsRequest injectPageSize(ListLunsRequest payload, int pageSize) { return ListLunsRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListLunsRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListLunsResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListLunsResponse payload) { return payload.getLunsList() == null ? ImmutableList.of() : payload.getLunsList(); } }; private static final PagedListDescriptor LIST_NFS_SHARES_PAGE_STR_DESC = new PagedListDescriptor() { @Override public String emptyToken() { return ""; } @Override public ListNfsSharesRequest injectToken(ListNfsSharesRequest payload, String token) { return ListNfsSharesRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListNfsSharesRequest injectPageSize(ListNfsSharesRequest payload, int pageSize) { return ListNfsSharesRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListNfsSharesRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListNfsSharesResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListNfsSharesResponse payload) { return payload.getNfsSharesList() == null ? ImmutableList.of() : payload.getNfsSharesList(); } }; private static final PagedListResponseFactory< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> LIST_INSTANCES_PAGE_STR_FACT = new PagedListResponseFactory< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListInstancesRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListVolumesRequest, ListVolumesResponse, ListVolumesPagedResponse> LIST_VOLUMES_PAGE_STR_FACT = new PagedListResponseFactory< ListVolumesRequest, ListVolumesResponse, ListVolumesPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListVolumesRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_VOLUMES_PAGE_STR_DESC, request, context); return ListVolumesPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListNetworksRequest, ListNetworksResponse, ListNetworksPagedResponse> LIST_NETWORKS_PAGE_STR_FACT = new PagedListResponseFactory< ListNetworksRequest, ListNetworksResponse, ListNetworksPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListNetworksRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_NETWORKS_PAGE_STR_DESC, request, context); return ListNetworksPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListLunsRequest, ListLunsResponse, ListLunsPagedResponse> LIST_LUNS_PAGE_STR_FACT = new PagedListResponseFactory() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListLunsRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_LUNS_PAGE_STR_DESC, request, context); return ListLunsPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListNfsSharesRequest, ListNfsSharesResponse, ListNfsSharesPagedResponse> LIST_NFS_SHARES_PAGE_STR_FACT = new PagedListResponseFactory< ListNfsSharesRequest, ListNfsSharesResponse, ListNfsSharesPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListNfsSharesRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create(callable, LIST_NFS_SHARES_PAGE_STR_DESC, request, context); return ListNfsSharesPagedResponse.createAsync(pageContext, futureResponse); } }; /** Returns the object with the settings used for calls to listInstances. */ public PagedCallSettings listInstancesSettings() { return listInstancesSettings; } /** Returns the object with the settings used for calls to getInstance. */ public UnaryCallSettings getInstanceSettings() { return getInstanceSettings; } /** Returns the object with the settings used for calls to updateInstance. */ public UnaryCallSettings updateInstanceSettings() { return updateInstanceSettings; } /** Returns the object with the settings used for calls to updateInstance. */ public OperationCallSettings updateInstanceOperationSettings() { return updateInstanceOperationSettings; } /** Returns the object with the settings used for calls to resetInstance. */ public UnaryCallSettings resetInstanceSettings() { return resetInstanceSettings; } /** Returns the object with the settings used for calls to resetInstance. */ public OperationCallSettings resetInstanceOperationSettings() { return resetInstanceOperationSettings; } /** Returns the object with the settings used for calls to startInstance. */ public UnaryCallSettings startInstanceSettings() { return startInstanceSettings; } /** Returns the object with the settings used for calls to startInstance. */ public OperationCallSettings startInstanceOperationSettings() { return startInstanceOperationSettings; } /** Returns the object with the settings used for calls to stopInstance. */ public UnaryCallSettings stopInstanceSettings() { return stopInstanceSettings; } /** Returns the object with the settings used for calls to stopInstance. */ public OperationCallSettings stopInstanceOperationSettings() { return stopInstanceOperationSettings; } /** Returns the object with the settings used for calls to detachLun. */ public UnaryCallSettings detachLunSettings() { return detachLunSettings; } /** Returns the object with the settings used for calls to detachLun. */ public OperationCallSettings detachLunOperationSettings() { return detachLunOperationSettings; } /** Returns the object with the settings used for calls to listVolumes. */ public PagedCallSettings listVolumesSettings() { return listVolumesSettings; } /** Returns the object with the settings used for calls to getVolume. */ public UnaryCallSettings getVolumeSettings() { return getVolumeSettings; } /** Returns the object with the settings used for calls to updateVolume. */ public UnaryCallSettings updateVolumeSettings() { return updateVolumeSettings; } /** Returns the object with the settings used for calls to updateVolume. */ public OperationCallSettings updateVolumeOperationSettings() { return updateVolumeOperationSettings; } /** Returns the object with the settings used for calls to resizeVolume. */ public UnaryCallSettings resizeVolumeSettings() { return resizeVolumeSettings; } /** Returns the object with the settings used for calls to resizeVolume. */ public OperationCallSettings resizeVolumeOperationSettings() { return resizeVolumeOperationSettings; } /** Returns the object with the settings used for calls to listNetworks. */ public PagedCallSettings listNetworksSettings() { return listNetworksSettings; } /** Returns the object with the settings used for calls to listNetworkUsage. */ public UnaryCallSettings listNetworkUsageSettings() { return listNetworkUsageSettings; } /** Returns the object with the settings used for calls to getNetwork. */ public UnaryCallSettings getNetworkSettings() { return getNetworkSettings; } /** Returns the object with the settings used for calls to updateNetwork. */ public UnaryCallSettings updateNetworkSettings() { return updateNetworkSettings; } /** Returns the object with the settings used for calls to updateNetwork. */ public OperationCallSettings updateNetworkOperationSettings() { return updateNetworkOperationSettings; } /** Returns the object with the settings used for calls to getLun. */ public UnaryCallSettings getLunSettings() { return getLunSettings; } /** Returns the object with the settings used for calls to listLuns. */ public PagedCallSettings listLunsSettings() { return listLunsSettings; } /** Returns the object with the settings used for calls to getNfsShare. */ public UnaryCallSettings getNfsShareSettings() { return getNfsShareSettings; } /** Returns the object with the settings used for calls to listNfsShares. */ public PagedCallSettings listNfsSharesSettings() { return listNfsSharesSettings; } /** Returns the object with the settings used for calls to updateNfsShare. */ public UnaryCallSettings updateNfsShareSettings() { return updateNfsShareSettings; } /** Returns the object with the settings used for calls to updateNfsShare. */ public OperationCallSettings updateNfsShareOperationSettings() { return updateNfsShareOperationSettings; } public BareMetalSolutionStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcBareMetalSolutionStub.create(this); } if (getTransportChannelProvider() .getTransportName() .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { return HttpJsonBareMetalSolutionStub.create(this); } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); } /** Returns the default service endpoint. */ public static String getDefaultEndpoint() { return "baremetalsolution.googleapis.com:443"; } /** Returns the default mTLS service endpoint. */ public static String getDefaultMtlsEndpoint() { return "baremetalsolution.mtls.googleapis.com:443"; } /** Returns the default service scopes. */ public static List getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { return GoogleCredentialsProvider.newBuilder() .setScopesToApply(DEFAULT_SERVICE_SCOPES) .setUseJwtAccessWithScope(true); } /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } /** Returns a builder for the default REST ChannelProvider for this service. */ @BetaApi public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder() { return InstantiatingHttpJsonChannelProvider.newBuilder(); } public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(BareMetalSolutionStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(BareMetalSolutionStubSettings.class)) .setTransportToken( GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); } public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return BareMetalSolutionStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); } /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } /** Returns a new REST builder for this class. */ public static Builder newHttpJsonBuilder() { return Builder.createHttpJsonDefault(); } /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); } /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } protected BareMetalSolutionStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); listInstancesSettings = settingsBuilder.listInstancesSettings().build(); getInstanceSettings = settingsBuilder.getInstanceSettings().build(); updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); resetInstanceSettings = settingsBuilder.resetInstanceSettings().build(); resetInstanceOperationSettings = settingsBuilder.resetInstanceOperationSettings().build(); startInstanceSettings = settingsBuilder.startInstanceSettings().build(); startInstanceOperationSettings = settingsBuilder.startInstanceOperationSettings().build(); stopInstanceSettings = settingsBuilder.stopInstanceSettings().build(); stopInstanceOperationSettings = settingsBuilder.stopInstanceOperationSettings().build(); detachLunSettings = settingsBuilder.detachLunSettings().build(); detachLunOperationSettings = settingsBuilder.detachLunOperationSettings().build(); listVolumesSettings = settingsBuilder.listVolumesSettings().build(); getVolumeSettings = settingsBuilder.getVolumeSettings().build(); updateVolumeSettings = settingsBuilder.updateVolumeSettings().build(); updateVolumeOperationSettings = settingsBuilder.updateVolumeOperationSettings().build(); resizeVolumeSettings = settingsBuilder.resizeVolumeSettings().build(); resizeVolumeOperationSettings = settingsBuilder.resizeVolumeOperationSettings().build(); listNetworksSettings = settingsBuilder.listNetworksSettings().build(); listNetworkUsageSettings = settingsBuilder.listNetworkUsageSettings().build(); getNetworkSettings = settingsBuilder.getNetworkSettings().build(); updateNetworkSettings = settingsBuilder.updateNetworkSettings().build(); updateNetworkOperationSettings = settingsBuilder.updateNetworkOperationSettings().build(); getLunSettings = settingsBuilder.getLunSettings().build(); listLunsSettings = settingsBuilder.listLunsSettings().build(); getNfsShareSettings = settingsBuilder.getNfsShareSettings().build(); listNfsSharesSettings = settingsBuilder.listNfsSharesSettings().build(); updateNfsShareSettings = settingsBuilder.updateNfsShareSettings().build(); updateNfsShareOperationSettings = settingsBuilder.updateNfsShareOperationSettings().build(); } /** Builder for BareMetalSolutionStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; private final PagedCallSettings.Builder< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> listInstancesSettings; private final UnaryCallSettings.Builder getInstanceSettings; private final UnaryCallSettings.Builder updateInstanceSettings; private final OperationCallSettings.Builder updateInstanceOperationSettings; private final UnaryCallSettings.Builder resetInstanceSettings; private final OperationCallSettings.Builder< ResetInstanceRequest, ResetInstanceResponse, OperationMetadata> resetInstanceOperationSettings; private final UnaryCallSettings.Builder startInstanceSettings; private final OperationCallSettings.Builder< StartInstanceRequest, StartInstanceResponse, OperationMetadata> startInstanceOperationSettings; private final UnaryCallSettings.Builder stopInstanceSettings; private final OperationCallSettings.Builder< StopInstanceRequest, StopInstanceResponse, OperationMetadata> stopInstanceOperationSettings; private final UnaryCallSettings.Builder detachLunSettings; private final OperationCallSettings.Builder detachLunOperationSettings; private final PagedCallSettings.Builder< ListVolumesRequest, ListVolumesResponse, ListVolumesPagedResponse> listVolumesSettings; private final UnaryCallSettings.Builder getVolumeSettings; private final UnaryCallSettings.Builder updateVolumeSettings; private final OperationCallSettings.Builder updateVolumeOperationSettings; private final UnaryCallSettings.Builder resizeVolumeSettings; private final OperationCallSettings.Builder resizeVolumeOperationSettings; private final PagedCallSettings.Builder< ListNetworksRequest, ListNetworksResponse, ListNetworksPagedResponse> listNetworksSettings; private final UnaryCallSettings.Builder listNetworkUsageSettings; private final UnaryCallSettings.Builder getNetworkSettings; private final UnaryCallSettings.Builder updateNetworkSettings; private final OperationCallSettings.Builder updateNetworkOperationSettings; private final UnaryCallSettings.Builder getLunSettings; private final PagedCallSettings.Builder< ListLunsRequest, ListLunsResponse, ListLunsPagedResponse> listLunsSettings; private final UnaryCallSettings.Builder getNfsShareSettings; private final PagedCallSettings.Builder< ListNfsSharesRequest, ListNfsSharesResponse, ListNfsSharesPagedResponse> listNfsSharesSettings; private final UnaryCallSettings.Builder updateNfsShareSettings; private final OperationCallSettings.Builder updateNfsShareOperationSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } private static final ImmutableMap RETRY_PARAM_DEFINITIONS; static { ImmutableMap.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; settings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); definitions.put("no_retry_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(clientContext); listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateInstanceOperationSettings = OperationCallSettings.newBuilder(); resetInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); resetInstanceOperationSettings = OperationCallSettings.newBuilder(); startInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); startInstanceOperationSettings = OperationCallSettings.newBuilder(); stopInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); stopInstanceOperationSettings = OperationCallSettings.newBuilder(); detachLunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); detachLunOperationSettings = OperationCallSettings.newBuilder(); listVolumesSettings = PagedCallSettings.newBuilder(LIST_VOLUMES_PAGE_STR_FACT); getVolumeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateVolumeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateVolumeOperationSettings = OperationCallSettings.newBuilder(); resizeVolumeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); resizeVolumeOperationSettings = OperationCallSettings.newBuilder(); listNetworksSettings = PagedCallSettings.newBuilder(LIST_NETWORKS_PAGE_STR_FACT); listNetworkUsageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateNetworkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateNetworkOperationSettings = OperationCallSettings.newBuilder(); getLunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLunsSettings = PagedCallSettings.newBuilder(LIST_LUNS_PAGE_STR_FACT); getNfsShareSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listNfsSharesSettings = PagedCallSettings.newBuilder(LIST_NFS_SHARES_PAGE_STR_FACT); updateNfsShareSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateNfsShareOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( listInstancesSettings, getInstanceSettings, updateInstanceSettings, resetInstanceSettings, startInstanceSettings, stopInstanceSettings, detachLunSettings, listVolumesSettings, getVolumeSettings, updateVolumeSettings, resizeVolumeSettings, listNetworksSettings, listNetworkUsageSettings, getNetworkSettings, updateNetworkSettings, getLunSettings, listLunsSettings, getNfsShareSettings, listNfsSharesSettings, updateNfsShareSettings); initDefaults(this); } protected Builder(BareMetalSolutionStubSettings settings) { super(settings); listInstancesSettings = settings.listInstancesSettings.toBuilder(); getInstanceSettings = settings.getInstanceSettings.toBuilder(); updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); resetInstanceSettings = settings.resetInstanceSettings.toBuilder(); resetInstanceOperationSettings = settings.resetInstanceOperationSettings.toBuilder(); startInstanceSettings = settings.startInstanceSettings.toBuilder(); startInstanceOperationSettings = settings.startInstanceOperationSettings.toBuilder(); stopInstanceSettings = settings.stopInstanceSettings.toBuilder(); stopInstanceOperationSettings = settings.stopInstanceOperationSettings.toBuilder(); detachLunSettings = settings.detachLunSettings.toBuilder(); detachLunOperationSettings = settings.detachLunOperationSettings.toBuilder(); listVolumesSettings = settings.listVolumesSettings.toBuilder(); getVolumeSettings = settings.getVolumeSettings.toBuilder(); updateVolumeSettings = settings.updateVolumeSettings.toBuilder(); updateVolumeOperationSettings = settings.updateVolumeOperationSettings.toBuilder(); resizeVolumeSettings = settings.resizeVolumeSettings.toBuilder(); resizeVolumeOperationSettings = settings.resizeVolumeOperationSettings.toBuilder(); listNetworksSettings = settings.listNetworksSettings.toBuilder(); listNetworkUsageSettings = settings.listNetworkUsageSettings.toBuilder(); getNetworkSettings = settings.getNetworkSettings.toBuilder(); updateNetworkSettings = settings.updateNetworkSettings.toBuilder(); updateNetworkOperationSettings = settings.updateNetworkOperationSettings.toBuilder(); getLunSettings = settings.getLunSettings.toBuilder(); listLunsSettings = settings.listLunsSettings.toBuilder(); getNfsShareSettings = settings.getNfsShareSettings.toBuilder(); listNfsSharesSettings = settings.listNfsSharesSettings.toBuilder(); updateNfsShareSettings = settings.updateNfsShareSettings.toBuilder(); updateNfsShareOperationSettings = settings.updateNfsShareOperationSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( listInstancesSettings, getInstanceSettings, updateInstanceSettings, resetInstanceSettings, startInstanceSettings, stopInstanceSettings, detachLunSettings, listVolumesSettings, getVolumeSettings, updateVolumeSettings, resizeVolumeSettings, listNetworksSettings, listNetworkUsageSettings, getNetworkSettings, updateNetworkSettings, getLunSettings, listLunsSettings, getNfsShareSettings, listNfsSharesSettings, updateNfsShareSettings); } private static Builder createDefault() { Builder builder = new Builder(((ClientContext) null)); builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } private static Builder createHttpJsonDefault() { Builder builder = new Builder(((ClientContext) null)); builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } private static Builder initDefaults(Builder builder) { builder .listInstancesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .updateInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .resetInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .startInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .stopInstanceSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .detachLunSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .listVolumesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getVolumeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .updateVolumeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .resizeVolumeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .listNetworksSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .listNetworkUsageSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getNetworkSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .updateNetworkSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getLunSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .listLunsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .getNfsShareSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .listNfsSharesSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .updateNfsShareSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .updateInstanceOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .resetInstanceOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(ResetInstanceResponse.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .startInstanceOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(StartInstanceResponse.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .stopInstanceOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(StopInstanceResponse.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .detachLunOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .updateVolumeOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Volume.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .resizeVolumeOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Volume.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .updateNetworkOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Network.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); builder .updateNfsShareOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(NfsShare.class)) .setMetadataTransformer( ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) .setMaxRetryDelay(Duration.ofMillis(45000L)) .setInitialRpcTimeout(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } /** * Applies the given settings updater function to all of the unary API methods in this service. * *

Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } public ImmutableList> unaryMethodSettingsBuilders() { return unaryMethodSettingsBuilders; } /** Returns the builder for the settings used for calls to listInstances. */ public PagedCallSettings.Builder< ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> listInstancesSettings() { return listInstancesSettings; } /** Returns the builder for the settings used for calls to getInstance. */ public UnaryCallSettings.Builder getInstanceSettings() { return getInstanceSettings; } /** Returns the builder for the settings used for calls to updateInstance. */ public UnaryCallSettings.Builder updateInstanceSettings() { return updateInstanceSettings; } /** Returns the builder for the settings used for calls to updateInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder updateInstanceOperationSettings() { return updateInstanceOperationSettings; } /** Returns the builder for the settings used for calls to resetInstance. */ public UnaryCallSettings.Builder resetInstanceSettings() { return resetInstanceSettings; } /** Returns the builder for the settings used for calls to resetInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< ResetInstanceRequest, ResetInstanceResponse, OperationMetadata> resetInstanceOperationSettings() { return resetInstanceOperationSettings; } /** Returns the builder for the settings used for calls to startInstance. */ public UnaryCallSettings.Builder startInstanceSettings() { return startInstanceSettings; } /** Returns the builder for the settings used for calls to startInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< StartInstanceRequest, StartInstanceResponse, OperationMetadata> startInstanceOperationSettings() { return startInstanceOperationSettings; } /** Returns the builder for the settings used for calls to stopInstance. */ public UnaryCallSettings.Builder stopInstanceSettings() { return stopInstanceSettings; } /** Returns the builder for the settings used for calls to stopInstance. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< StopInstanceRequest, StopInstanceResponse, OperationMetadata> stopInstanceOperationSettings() { return stopInstanceOperationSettings; } /** Returns the builder for the settings used for calls to detachLun. */ public UnaryCallSettings.Builder detachLunSettings() { return detachLunSettings; } /** Returns the builder for the settings used for calls to detachLun. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder detachLunOperationSettings() { return detachLunOperationSettings; } /** Returns the builder for the settings used for calls to listVolumes. */ public PagedCallSettings.Builder< ListVolumesRequest, ListVolumesResponse, ListVolumesPagedResponse> listVolumesSettings() { return listVolumesSettings; } /** Returns the builder for the settings used for calls to getVolume. */ public UnaryCallSettings.Builder getVolumeSettings() { return getVolumeSettings; } /** Returns the builder for the settings used for calls to updateVolume. */ public UnaryCallSettings.Builder updateVolumeSettings() { return updateVolumeSettings; } /** Returns the builder for the settings used for calls to updateVolume. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder updateVolumeOperationSettings() { return updateVolumeOperationSettings; } /** Returns the builder for the settings used for calls to resizeVolume. */ public UnaryCallSettings.Builder resizeVolumeSettings() { return resizeVolumeSettings; } /** Returns the builder for the settings used for calls to resizeVolume. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder resizeVolumeOperationSettings() { return resizeVolumeOperationSettings; } /** Returns the builder for the settings used for calls to listNetworks. */ public PagedCallSettings.Builder< ListNetworksRequest, ListNetworksResponse, ListNetworksPagedResponse> listNetworksSettings() { return listNetworksSettings; } /** Returns the builder for the settings used for calls to listNetworkUsage. */ public UnaryCallSettings.Builder listNetworkUsageSettings() { return listNetworkUsageSettings; } /** Returns the builder for the settings used for calls to getNetwork. */ public UnaryCallSettings.Builder getNetworkSettings() { return getNetworkSettings; } /** Returns the builder for the settings used for calls to updateNetwork. */ public UnaryCallSettings.Builder updateNetworkSettings() { return updateNetworkSettings; } /** Returns the builder for the settings used for calls to updateNetwork. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder updateNetworkOperationSettings() { return updateNetworkOperationSettings; } /** Returns the builder for the settings used for calls to getLun. */ public UnaryCallSettings.Builder getLunSettings() { return getLunSettings; } /** Returns the builder for the settings used for calls to listLuns. */ public PagedCallSettings.Builder listLunsSettings() { return listLunsSettings; } /** Returns the builder for the settings used for calls to getNfsShare. */ public UnaryCallSettings.Builder getNfsShareSettings() { return getNfsShareSettings; } /** Returns the builder for the settings used for calls to listNfsShares. */ public PagedCallSettings.Builder< ListNfsSharesRequest, ListNfsSharesResponse, ListNfsSharesPagedResponse> listNfsSharesSettings() { return listNfsSharesSettings; } /** Returns the builder for the settings used for calls to updateNfsShare. */ public UnaryCallSettings.Builder updateNfsShareSettings() { return updateNfsShareSettings; } /** Returns the builder for the settings used for calls to updateNfsShare. */ @BetaApi( "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder updateNfsShareOperationSettings() { return updateNfsShareOperationSettings; } @Override public BareMetalSolutionStubSettings build() throws IOException { return new BareMetalSolutionStubSettings(this); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy