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

com.google.cloud.gkemulticloud.v1.stub.AzureClustersStubSettings Maven / Gradle / Ivy

Go to download

Anthos Multicloud enables you to provision and manage GKE clusters running on AWS and Azure infrastructure through a centralized Google Cloud backed control plane.

There is a newer version: 0.53.0
Show newest version
/*
 * Copyright 2024 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.gkemulticloud.v1.stub;

import static com.google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureClientsPagedResponse;
import static com.google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureClustersPagedResponse;
import static com.google.cloud.gkemulticloud.v1.AzureClustersClient.ListAzureNodePoolsPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.core.ObsoleteApi;
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.gkemulticloud.v1.AzureClient;
import com.google.cloud.gkemulticloud.v1.AzureCluster;
import com.google.cloud.gkemulticloud.v1.AzureJsonWebKeys;
import com.google.cloud.gkemulticloud.v1.AzureNodePool;
import com.google.cloud.gkemulticloud.v1.AzureOpenIdConfig;
import com.google.cloud.gkemulticloud.v1.AzureServerConfig;
import com.google.cloud.gkemulticloud.v1.CreateAzureClientRequest;
import com.google.cloud.gkemulticloud.v1.CreateAzureClusterRequest;
import com.google.cloud.gkemulticloud.v1.CreateAzureNodePoolRequest;
import com.google.cloud.gkemulticloud.v1.DeleteAzureClientRequest;
import com.google.cloud.gkemulticloud.v1.DeleteAzureClusterRequest;
import com.google.cloud.gkemulticloud.v1.DeleteAzureNodePoolRequest;
import com.google.cloud.gkemulticloud.v1.GenerateAzureAccessTokenRequest;
import com.google.cloud.gkemulticloud.v1.GenerateAzureAccessTokenResponse;
import com.google.cloud.gkemulticloud.v1.GenerateAzureClusterAgentTokenRequest;
import com.google.cloud.gkemulticloud.v1.GenerateAzureClusterAgentTokenResponse;
import com.google.cloud.gkemulticloud.v1.GetAzureClientRequest;
import com.google.cloud.gkemulticloud.v1.GetAzureClusterRequest;
import com.google.cloud.gkemulticloud.v1.GetAzureJsonWebKeysRequest;
import com.google.cloud.gkemulticloud.v1.GetAzureNodePoolRequest;
import com.google.cloud.gkemulticloud.v1.GetAzureOpenIdConfigRequest;
import com.google.cloud.gkemulticloud.v1.GetAzureServerConfigRequest;
import com.google.cloud.gkemulticloud.v1.ListAzureClientsRequest;
import com.google.cloud.gkemulticloud.v1.ListAzureClientsResponse;
import com.google.cloud.gkemulticloud.v1.ListAzureClustersRequest;
import com.google.cloud.gkemulticloud.v1.ListAzureClustersResponse;
import com.google.cloud.gkemulticloud.v1.ListAzureNodePoolsRequest;
import com.google.cloud.gkemulticloud.v1.ListAzureNodePoolsResponse;
import com.google.cloud.gkemulticloud.v1.OperationMetadata;
import com.google.cloud.gkemulticloud.v1.UpdateAzureClusterRequest;
import com.google.cloud.gkemulticloud.v1.UpdateAzureNodePoolRequest;
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 com.google.protobuf.Empty;
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 AzureClustersStub}.
 *
 * 

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

    *
  • The default service address (gkemulticloud.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 * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) * of getAzureClient: * *

{@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
 * AzureClustersStubSettings.Builder azureClustersSettingsBuilder =
 *     AzureClustersStubSettings.newBuilder();
 * azureClustersSettingsBuilder
 *     .getAzureClientSettings()
 *     .setRetrySettings(
 *         azureClustersSettingsBuilder
 *             .getAzureClientSettings()
 *             .getRetrySettings()
 *             .toBuilder()
 *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
 *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
 *             .setMaxAttempts(5)
 *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
 *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
 *             .setRetryDelayMultiplier(1.3)
 *             .setRpcTimeoutMultiplier(1.5)
 *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
 *             .build());
 * AzureClustersStubSettings azureClustersSettings = azureClustersSettingsBuilder.build();
 * }
* * Please refer to the [Client Side Retry * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for * additional support in setting retries. * *

To configure the RetrySettings of a Long Running Operation method, create an * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to * configure the RetrySettings for createAzureClient: * *

{@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
 * AzureClustersStubSettings.Builder azureClustersSettingsBuilder =
 *     AzureClustersStubSettings.newBuilder();
 * TimedRetryAlgorithm timedRetryAlgorithm =
 *     OperationalTimedPollAlgorithm.create(
 *         RetrySettings.newBuilder()
 *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
 *             .setRetryDelayMultiplier(1.5)
 *             .setMaxRetryDelay(Duration.ofMillis(5000))
 *             .setTotalTimeoutDuration(Duration.ofHours(24))
 *             .build());
 * azureClustersSettingsBuilder
 *     .createClusterOperationSettings()
 *     .setPollingAlgorithm(timedRetryAlgorithm)
 *     .build();
 * }
*/ @Generated("by gapic-generator-java") public class AzureClustersStubSettings 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 UnaryCallSettings createAzureClientSettings; private final OperationCallSettings createAzureClientOperationSettings; private final UnaryCallSettings getAzureClientSettings; private final PagedCallSettings< ListAzureClientsRequest, ListAzureClientsResponse, ListAzureClientsPagedResponse> listAzureClientsSettings; private final UnaryCallSettings deleteAzureClientSettings; private final OperationCallSettings deleteAzureClientOperationSettings; private final UnaryCallSettings createAzureClusterSettings; private final OperationCallSettings createAzureClusterOperationSettings; private final UnaryCallSettings updateAzureClusterSettings; private final OperationCallSettings updateAzureClusterOperationSettings; private final UnaryCallSettings getAzureClusterSettings; private final PagedCallSettings< ListAzureClustersRequest, ListAzureClustersResponse, ListAzureClustersPagedResponse> listAzureClustersSettings; private final UnaryCallSettings deleteAzureClusterSettings; private final OperationCallSettings deleteAzureClusterOperationSettings; private final UnaryCallSettings< GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse> generateAzureClusterAgentTokenSettings; private final UnaryCallSettings generateAzureAccessTokenSettings; private final UnaryCallSettings createAzureNodePoolSettings; private final OperationCallSettings createAzureNodePoolOperationSettings; private final UnaryCallSettings updateAzureNodePoolSettings; private final OperationCallSettings updateAzureNodePoolOperationSettings; private final UnaryCallSettings getAzureNodePoolSettings; private final PagedCallSettings< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, ListAzureNodePoolsPagedResponse> listAzureNodePoolsSettings; private final UnaryCallSettings deleteAzureNodePoolSettings; private final OperationCallSettings deleteAzureNodePoolOperationSettings; private final UnaryCallSettings getAzureOpenIdConfigSettings; private final UnaryCallSettings getAzureJsonWebKeysSettings; private final UnaryCallSettings getAzureServerConfigSettings; private static final PagedListDescriptor< ListAzureClientsRequest, ListAzureClientsResponse, AzureClient> LIST_AZURE_CLIENTS_PAGE_STR_DESC = new PagedListDescriptor< ListAzureClientsRequest, ListAzureClientsResponse, AzureClient>() { @Override public String emptyToken() { return ""; } @Override public ListAzureClientsRequest injectToken( ListAzureClientsRequest payload, String token) { return ListAzureClientsRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListAzureClientsRequest injectPageSize( ListAzureClientsRequest payload, int pageSize) { return ListAzureClientsRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListAzureClientsRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListAzureClientsResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListAzureClientsResponse payload) { return payload.getAzureClientsList(); } }; private static final PagedListDescriptor< ListAzureClustersRequest, ListAzureClustersResponse, AzureCluster> LIST_AZURE_CLUSTERS_PAGE_STR_DESC = new PagedListDescriptor< ListAzureClustersRequest, ListAzureClustersResponse, AzureCluster>() { @Override public String emptyToken() { return ""; } @Override public ListAzureClustersRequest injectToken( ListAzureClustersRequest payload, String token) { return ListAzureClustersRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListAzureClustersRequest injectPageSize( ListAzureClustersRequest payload, int pageSize) { return ListAzureClustersRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListAzureClustersRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListAzureClustersResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListAzureClustersResponse payload) { return payload.getAzureClustersList(); } }; private static final PagedListDescriptor< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, AzureNodePool> LIST_AZURE_NODE_POOLS_PAGE_STR_DESC = new PagedListDescriptor< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, AzureNodePool>() { @Override public String emptyToken() { return ""; } @Override public ListAzureNodePoolsRequest injectToken( ListAzureNodePoolsRequest payload, String token) { return ListAzureNodePoolsRequest.newBuilder(payload).setPageToken(token).build(); } @Override public ListAzureNodePoolsRequest injectPageSize( ListAzureNodePoolsRequest payload, int pageSize) { return ListAzureNodePoolsRequest.newBuilder(payload).setPageSize(pageSize).build(); } @Override public Integer extractPageSize(ListAzureNodePoolsRequest payload) { return payload.getPageSize(); } @Override public String extractNextToken(ListAzureNodePoolsResponse payload) { return payload.getNextPageToken(); } @Override public Iterable extractResources(ListAzureNodePoolsResponse payload) { return payload.getAzureNodePoolsList(); } }; private static final PagedListResponseFactory< ListAzureClientsRequest, ListAzureClientsResponse, ListAzureClientsPagedResponse> LIST_AZURE_CLIENTS_PAGE_STR_FACT = new PagedListResponseFactory< ListAzureClientsRequest, ListAzureClientsResponse, ListAzureClientsPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListAzureClientsRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create( callable, LIST_AZURE_CLIENTS_PAGE_STR_DESC, request, context); return ListAzureClientsPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListAzureClustersRequest, ListAzureClustersResponse, ListAzureClustersPagedResponse> LIST_AZURE_CLUSTERS_PAGE_STR_FACT = new PagedListResponseFactory< ListAzureClustersRequest, ListAzureClustersResponse, ListAzureClustersPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListAzureClustersRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create( callable, LIST_AZURE_CLUSTERS_PAGE_STR_DESC, request, context); return ListAzureClustersPagedResponse.createAsync(pageContext, futureResponse); } }; private static final PagedListResponseFactory< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, ListAzureNodePoolsPagedResponse> LIST_AZURE_NODE_POOLS_PAGE_STR_FACT = new PagedListResponseFactory< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, ListAzureNodePoolsPagedResponse>() { @Override public ApiFuture getFuturePagedResponse( UnaryCallable callable, ListAzureNodePoolsRequest request, ApiCallContext context, ApiFuture futureResponse) { PageContext pageContext = PageContext.create( callable, LIST_AZURE_NODE_POOLS_PAGE_STR_DESC, request, context); return ListAzureNodePoolsPagedResponse.createAsync(pageContext, futureResponse); } }; /** Returns the object with the settings used for calls to createAzureClient. */ public UnaryCallSettings createAzureClientSettings() { return createAzureClientSettings; } /** Returns the object with the settings used for calls to createAzureClient. */ public OperationCallSettings createAzureClientOperationSettings() { return createAzureClientOperationSettings; } /** Returns the object with the settings used for calls to getAzureClient. */ public UnaryCallSettings getAzureClientSettings() { return getAzureClientSettings; } /** Returns the object with the settings used for calls to listAzureClients. */ public PagedCallSettings< ListAzureClientsRequest, ListAzureClientsResponse, ListAzureClientsPagedResponse> listAzureClientsSettings() { return listAzureClientsSettings; } /** Returns the object with the settings used for calls to deleteAzureClient. */ public UnaryCallSettings deleteAzureClientSettings() { return deleteAzureClientSettings; } /** Returns the object with the settings used for calls to deleteAzureClient. */ public OperationCallSettings deleteAzureClientOperationSettings() { return deleteAzureClientOperationSettings; } /** Returns the object with the settings used for calls to createAzureCluster. */ public UnaryCallSettings createAzureClusterSettings() { return createAzureClusterSettings; } /** Returns the object with the settings used for calls to createAzureCluster. */ public OperationCallSettings createAzureClusterOperationSettings() { return createAzureClusterOperationSettings; } /** Returns the object with the settings used for calls to updateAzureCluster. */ public UnaryCallSettings updateAzureClusterSettings() { return updateAzureClusterSettings; } /** Returns the object with the settings used for calls to updateAzureCluster. */ public OperationCallSettings updateAzureClusterOperationSettings() { return updateAzureClusterOperationSettings; } /** Returns the object with the settings used for calls to getAzureCluster. */ public UnaryCallSettings getAzureClusterSettings() { return getAzureClusterSettings; } /** Returns the object with the settings used for calls to listAzureClusters. */ public PagedCallSettings< ListAzureClustersRequest, ListAzureClustersResponse, ListAzureClustersPagedResponse> listAzureClustersSettings() { return listAzureClustersSettings; } /** Returns the object with the settings used for calls to deleteAzureCluster. */ public UnaryCallSettings deleteAzureClusterSettings() { return deleteAzureClusterSettings; } /** Returns the object with the settings used for calls to deleteAzureCluster. */ public OperationCallSettings deleteAzureClusterOperationSettings() { return deleteAzureClusterOperationSettings; } /** Returns the object with the settings used for calls to generateAzureClusterAgentToken. */ public UnaryCallSettings< GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse> generateAzureClusterAgentTokenSettings() { return generateAzureClusterAgentTokenSettings; } /** Returns the object with the settings used for calls to generateAzureAccessToken. */ public UnaryCallSettings generateAzureAccessTokenSettings() { return generateAzureAccessTokenSettings; } /** Returns the object with the settings used for calls to createAzureNodePool. */ public UnaryCallSettings createAzureNodePoolSettings() { return createAzureNodePoolSettings; } /** Returns the object with the settings used for calls to createAzureNodePool. */ public OperationCallSettings createAzureNodePoolOperationSettings() { return createAzureNodePoolOperationSettings; } /** Returns the object with the settings used for calls to updateAzureNodePool. */ public UnaryCallSettings updateAzureNodePoolSettings() { return updateAzureNodePoolSettings; } /** Returns the object with the settings used for calls to updateAzureNodePool. */ public OperationCallSettings updateAzureNodePoolOperationSettings() { return updateAzureNodePoolOperationSettings; } /** Returns the object with the settings used for calls to getAzureNodePool. */ public UnaryCallSettings getAzureNodePoolSettings() { return getAzureNodePoolSettings; } /** Returns the object with the settings used for calls to listAzureNodePools. */ public PagedCallSettings< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, ListAzureNodePoolsPagedResponse> listAzureNodePoolsSettings() { return listAzureNodePoolsSettings; } /** Returns the object with the settings used for calls to deleteAzureNodePool. */ public UnaryCallSettings deleteAzureNodePoolSettings() { return deleteAzureNodePoolSettings; } /** Returns the object with the settings used for calls to deleteAzureNodePool. */ public OperationCallSettings deleteAzureNodePoolOperationSettings() { return deleteAzureNodePoolOperationSettings; } /** Returns the object with the settings used for calls to getAzureOpenIdConfig. */ public UnaryCallSettings getAzureOpenIdConfigSettings() { return getAzureOpenIdConfigSettings; } /** Returns the object with the settings used for calls to getAzureJsonWebKeys. */ public UnaryCallSettings getAzureJsonWebKeysSettings() { return getAzureJsonWebKeysSettings; } /** Returns the object with the settings used for calls to getAzureServerConfig. */ public UnaryCallSettings getAzureServerConfigSettings() { return getAzureServerConfigSettings; } public AzureClustersStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAzureClustersStub.create(this); } if (getTransportChannelProvider() .getTransportName() .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { return HttpJsonAzureClustersStub.create(this); } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns the default service name. */ @Override public String getServiceName() { return "gkemulticloud"; } /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); } /** Returns the default service endpoint. */ @ObsoleteApi("Use getEndpoint() instead") public static String getDefaultEndpoint() { return "gkemulticloud.googleapis.com:443"; } /** Returns the default mTLS service endpoint. */ public static String getDefaultMtlsEndpoint() { return "gkemulticloud.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(); } public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(AzureClustersStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(AzureClustersStubSettings.class)) .setTransportToken( GaxHttpJsonProperties.getHttpJsonTokenName(), GaxHttpJsonProperties.getHttpJsonVersion()); } public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return AzureClustersStubSettings.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 AzureClustersStubSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); createAzureClientSettings = settingsBuilder.createAzureClientSettings().build(); createAzureClientOperationSettings = settingsBuilder.createAzureClientOperationSettings().build(); getAzureClientSettings = settingsBuilder.getAzureClientSettings().build(); listAzureClientsSettings = settingsBuilder.listAzureClientsSettings().build(); deleteAzureClientSettings = settingsBuilder.deleteAzureClientSettings().build(); deleteAzureClientOperationSettings = settingsBuilder.deleteAzureClientOperationSettings().build(); createAzureClusterSettings = settingsBuilder.createAzureClusterSettings().build(); createAzureClusterOperationSettings = settingsBuilder.createAzureClusterOperationSettings().build(); updateAzureClusterSettings = settingsBuilder.updateAzureClusterSettings().build(); updateAzureClusterOperationSettings = settingsBuilder.updateAzureClusterOperationSettings().build(); getAzureClusterSettings = settingsBuilder.getAzureClusterSettings().build(); listAzureClustersSettings = settingsBuilder.listAzureClustersSettings().build(); deleteAzureClusterSettings = settingsBuilder.deleteAzureClusterSettings().build(); deleteAzureClusterOperationSettings = settingsBuilder.deleteAzureClusterOperationSettings().build(); generateAzureClusterAgentTokenSettings = settingsBuilder.generateAzureClusterAgentTokenSettings().build(); generateAzureAccessTokenSettings = settingsBuilder.generateAzureAccessTokenSettings().build(); createAzureNodePoolSettings = settingsBuilder.createAzureNodePoolSettings().build(); createAzureNodePoolOperationSettings = settingsBuilder.createAzureNodePoolOperationSettings().build(); updateAzureNodePoolSettings = settingsBuilder.updateAzureNodePoolSettings().build(); updateAzureNodePoolOperationSettings = settingsBuilder.updateAzureNodePoolOperationSettings().build(); getAzureNodePoolSettings = settingsBuilder.getAzureNodePoolSettings().build(); listAzureNodePoolsSettings = settingsBuilder.listAzureNodePoolsSettings().build(); deleteAzureNodePoolSettings = settingsBuilder.deleteAzureNodePoolSettings().build(); deleteAzureNodePoolOperationSettings = settingsBuilder.deleteAzureNodePoolOperationSettings().build(); getAzureOpenIdConfigSettings = settingsBuilder.getAzureOpenIdConfigSettings().build(); getAzureJsonWebKeysSettings = settingsBuilder.getAzureJsonWebKeysSettings().build(); getAzureServerConfigSettings = settingsBuilder.getAzureServerConfigSettings().build(); } /** Builder for AzureClustersStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; private final UnaryCallSettings.Builder createAzureClientSettings; private final OperationCallSettings.Builder< CreateAzureClientRequest, AzureClient, OperationMetadata> createAzureClientOperationSettings; private final UnaryCallSettings.Builder getAzureClientSettings; private final PagedCallSettings.Builder< ListAzureClientsRequest, ListAzureClientsResponse, ListAzureClientsPagedResponse> listAzureClientsSettings; private final UnaryCallSettings.Builder deleteAzureClientSettings; private final OperationCallSettings.Builder deleteAzureClientOperationSettings; private final UnaryCallSettings.Builder createAzureClusterSettings; private final OperationCallSettings.Builder< CreateAzureClusterRequest, AzureCluster, OperationMetadata> createAzureClusterOperationSettings; private final UnaryCallSettings.Builder updateAzureClusterSettings; private final OperationCallSettings.Builder< UpdateAzureClusterRequest, AzureCluster, OperationMetadata> updateAzureClusterOperationSettings; private final UnaryCallSettings.Builder getAzureClusterSettings; private final PagedCallSettings.Builder< ListAzureClustersRequest, ListAzureClustersResponse, ListAzureClustersPagedResponse> listAzureClustersSettings; private final UnaryCallSettings.Builder deleteAzureClusterSettings; private final OperationCallSettings.Builder deleteAzureClusterOperationSettings; private final UnaryCallSettings.Builder< GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse> generateAzureClusterAgentTokenSettings; private final UnaryCallSettings.Builder< GenerateAzureAccessTokenRequest, GenerateAzureAccessTokenResponse> generateAzureAccessTokenSettings; private final UnaryCallSettings.Builder createAzureNodePoolSettings; private final OperationCallSettings.Builder< CreateAzureNodePoolRequest, AzureNodePool, OperationMetadata> createAzureNodePoolOperationSettings; private final UnaryCallSettings.Builder updateAzureNodePoolSettings; private final OperationCallSettings.Builder< UpdateAzureNodePoolRequest, AzureNodePool, OperationMetadata> updateAzureNodePoolOperationSettings; private final UnaryCallSettings.Builder getAzureNodePoolSettings; private final PagedCallSettings.Builder< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, ListAzureNodePoolsPagedResponse> listAzureNodePoolsSettings; private final UnaryCallSettings.Builder deleteAzureNodePoolSettings; private final OperationCallSettings.Builder< DeleteAzureNodePoolRequest, Empty, OperationMetadata> deleteAzureNodePoolOperationSettings; private final UnaryCallSettings.Builder getAzureOpenIdConfigSettings; private final UnaryCallSettings.Builder getAzureJsonWebKeysSettings; private final UnaryCallSettings.Builder getAzureServerConfigSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); 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_1_params", settings); settings = RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(1.3) .setMaxRetryDelay(Duration.ofMillis(10000L)) .setInitialRpcTimeout(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(clientContext); createAzureClientSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createAzureClientOperationSettings = OperationCallSettings.newBuilder(); getAzureClientSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listAzureClientsSettings = PagedCallSettings.newBuilder(LIST_AZURE_CLIENTS_PAGE_STR_FACT); deleteAzureClientSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteAzureClientOperationSettings = OperationCallSettings.newBuilder(); createAzureClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createAzureClusterOperationSettings = OperationCallSettings.newBuilder(); updateAzureClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateAzureClusterOperationSettings = OperationCallSettings.newBuilder(); getAzureClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listAzureClustersSettings = PagedCallSettings.newBuilder(LIST_AZURE_CLUSTERS_PAGE_STR_FACT); deleteAzureClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteAzureClusterOperationSettings = OperationCallSettings.newBuilder(); generateAzureClusterAgentTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); generateAzureAccessTokenSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createAzureNodePoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createAzureNodePoolOperationSettings = OperationCallSettings.newBuilder(); updateAzureNodePoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateAzureNodePoolOperationSettings = OperationCallSettings.newBuilder(); getAzureNodePoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listAzureNodePoolsSettings = PagedCallSettings.newBuilder(LIST_AZURE_NODE_POOLS_PAGE_STR_FACT); deleteAzureNodePoolSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteAzureNodePoolOperationSettings = OperationCallSettings.newBuilder(); getAzureOpenIdConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getAzureJsonWebKeysSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getAzureServerConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createAzureClientSettings, getAzureClientSettings, listAzureClientsSettings, deleteAzureClientSettings, createAzureClusterSettings, updateAzureClusterSettings, getAzureClusterSettings, listAzureClustersSettings, deleteAzureClusterSettings, generateAzureClusterAgentTokenSettings, generateAzureAccessTokenSettings, createAzureNodePoolSettings, updateAzureNodePoolSettings, getAzureNodePoolSettings, listAzureNodePoolsSettings, deleteAzureNodePoolSettings, getAzureOpenIdConfigSettings, getAzureJsonWebKeysSettings, getAzureServerConfigSettings); initDefaults(this); } protected Builder(AzureClustersStubSettings settings) { super(settings); createAzureClientSettings = settings.createAzureClientSettings.toBuilder(); createAzureClientOperationSettings = settings.createAzureClientOperationSettings.toBuilder(); getAzureClientSettings = settings.getAzureClientSettings.toBuilder(); listAzureClientsSettings = settings.listAzureClientsSettings.toBuilder(); deleteAzureClientSettings = settings.deleteAzureClientSettings.toBuilder(); deleteAzureClientOperationSettings = settings.deleteAzureClientOperationSettings.toBuilder(); createAzureClusterSettings = settings.createAzureClusterSettings.toBuilder(); createAzureClusterOperationSettings = settings.createAzureClusterOperationSettings.toBuilder(); updateAzureClusterSettings = settings.updateAzureClusterSettings.toBuilder(); updateAzureClusterOperationSettings = settings.updateAzureClusterOperationSettings.toBuilder(); getAzureClusterSettings = settings.getAzureClusterSettings.toBuilder(); listAzureClustersSettings = settings.listAzureClustersSettings.toBuilder(); deleteAzureClusterSettings = settings.deleteAzureClusterSettings.toBuilder(); deleteAzureClusterOperationSettings = settings.deleteAzureClusterOperationSettings.toBuilder(); generateAzureClusterAgentTokenSettings = settings.generateAzureClusterAgentTokenSettings.toBuilder(); generateAzureAccessTokenSettings = settings.generateAzureAccessTokenSettings.toBuilder(); createAzureNodePoolSettings = settings.createAzureNodePoolSettings.toBuilder(); createAzureNodePoolOperationSettings = settings.createAzureNodePoolOperationSettings.toBuilder(); updateAzureNodePoolSettings = settings.updateAzureNodePoolSettings.toBuilder(); updateAzureNodePoolOperationSettings = settings.updateAzureNodePoolOperationSettings.toBuilder(); getAzureNodePoolSettings = settings.getAzureNodePoolSettings.toBuilder(); listAzureNodePoolsSettings = settings.listAzureNodePoolsSettings.toBuilder(); deleteAzureNodePoolSettings = settings.deleteAzureNodePoolSettings.toBuilder(); deleteAzureNodePoolOperationSettings = settings.deleteAzureNodePoolOperationSettings.toBuilder(); getAzureOpenIdConfigSettings = settings.getAzureOpenIdConfigSettings.toBuilder(); getAzureJsonWebKeysSettings = settings.getAzureJsonWebKeysSettings.toBuilder(); getAzureServerConfigSettings = settings.getAzureServerConfigSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( createAzureClientSettings, getAzureClientSettings, listAzureClientsSettings, deleteAzureClientSettings, createAzureClusterSettings, updateAzureClusterSettings, getAzureClusterSettings, listAzureClustersSettings, deleteAzureClusterSettings, generateAzureClusterAgentTokenSettings, generateAzureAccessTokenSettings, createAzureNodePoolSettings, updateAzureNodePoolSettings, getAzureNodePoolSettings, listAzureNodePoolsSettings, deleteAzureNodePoolSettings, getAzureOpenIdConfigSettings, getAzureJsonWebKeysSettings, getAzureServerConfigSettings); } private static Builder createDefault() { Builder builder = new Builder(((ClientContext) null)); builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); 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.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } private static Builder initDefaults(Builder builder) { builder .createAzureClientSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getAzureClientSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listAzureClientsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteAzureClientSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .createAzureClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .updateAzureClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getAzureClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listAzureClustersSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteAzureClusterSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .generateAzureClusterAgentTokenSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .generateAzureAccessTokenSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createAzureNodePoolSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .updateAzureNodePoolSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getAzureNodePoolSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listAzureNodePoolsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteAzureNodePoolSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getAzureOpenIdConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getAzureJsonWebKeysSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getAzureServerConfigSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createAzureClientOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AzureClient.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 .deleteAzureClientOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.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 .createAzureClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AzureCluster.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 .updateAzureClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AzureCluster.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 .deleteAzureClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.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 .createAzureNodePoolOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AzureNodePool.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 .updateAzureNodePoolOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AzureNodePool.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 .deleteAzureNodePoolOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.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 createAzureClient. */ public UnaryCallSettings.Builder createAzureClientSettings() { return createAzureClientSettings; } /** Returns the builder for the settings used for calls to createAzureClient. */ public OperationCallSettings.Builder createAzureClientOperationSettings() { return createAzureClientOperationSettings; } /** Returns the builder for the settings used for calls to getAzureClient. */ public UnaryCallSettings.Builder getAzureClientSettings() { return getAzureClientSettings; } /** Returns the builder for the settings used for calls to listAzureClients. */ public PagedCallSettings.Builder< ListAzureClientsRequest, ListAzureClientsResponse, ListAzureClientsPagedResponse> listAzureClientsSettings() { return listAzureClientsSettings; } /** Returns the builder for the settings used for calls to deleteAzureClient. */ public UnaryCallSettings.Builder deleteAzureClientSettings() { return deleteAzureClientSettings; } /** Returns the builder for the settings used for calls to deleteAzureClient. */ public OperationCallSettings.Builder deleteAzureClientOperationSettings() { return deleteAzureClientOperationSettings; } /** Returns the builder for the settings used for calls to createAzureCluster. */ public UnaryCallSettings.Builder createAzureClusterSettings() { return createAzureClusterSettings; } /** Returns the builder for the settings used for calls to createAzureCluster. */ public OperationCallSettings.Builder createAzureClusterOperationSettings() { return createAzureClusterOperationSettings; } /** Returns the builder for the settings used for calls to updateAzureCluster. */ public UnaryCallSettings.Builder updateAzureClusterSettings() { return updateAzureClusterSettings; } /** Returns the builder for the settings used for calls to updateAzureCluster. */ public OperationCallSettings.Builder updateAzureClusterOperationSettings() { return updateAzureClusterOperationSettings; } /** Returns the builder for the settings used for calls to getAzureCluster. */ public UnaryCallSettings.Builder getAzureClusterSettings() { return getAzureClusterSettings; } /** Returns the builder for the settings used for calls to listAzureClusters. */ public PagedCallSettings.Builder< ListAzureClustersRequest, ListAzureClustersResponse, ListAzureClustersPagedResponse> listAzureClustersSettings() { return listAzureClustersSettings; } /** Returns the builder for the settings used for calls to deleteAzureCluster. */ public UnaryCallSettings.Builder deleteAzureClusterSettings() { return deleteAzureClusterSettings; } /** Returns the builder for the settings used for calls to deleteAzureCluster. */ public OperationCallSettings.Builder deleteAzureClusterOperationSettings() { return deleteAzureClusterOperationSettings; } /** Returns the builder for the settings used for calls to generateAzureClusterAgentToken. */ public UnaryCallSettings.Builder< GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse> generateAzureClusterAgentTokenSettings() { return generateAzureClusterAgentTokenSettings; } /** Returns the builder for the settings used for calls to generateAzureAccessToken. */ public UnaryCallSettings.Builder< GenerateAzureAccessTokenRequest, GenerateAzureAccessTokenResponse> generateAzureAccessTokenSettings() { return generateAzureAccessTokenSettings; } /** Returns the builder for the settings used for calls to createAzureNodePool. */ public UnaryCallSettings.Builder createAzureNodePoolSettings() { return createAzureNodePoolSettings; } /** Returns the builder for the settings used for calls to createAzureNodePool. */ public OperationCallSettings.Builder< CreateAzureNodePoolRequest, AzureNodePool, OperationMetadata> createAzureNodePoolOperationSettings() { return createAzureNodePoolOperationSettings; } /** Returns the builder for the settings used for calls to updateAzureNodePool. */ public UnaryCallSettings.Builder updateAzureNodePoolSettings() { return updateAzureNodePoolSettings; } /** Returns the builder for the settings used for calls to updateAzureNodePool. */ public OperationCallSettings.Builder< UpdateAzureNodePoolRequest, AzureNodePool, OperationMetadata> updateAzureNodePoolOperationSettings() { return updateAzureNodePoolOperationSettings; } /** Returns the builder for the settings used for calls to getAzureNodePool. */ public UnaryCallSettings.Builder getAzureNodePoolSettings() { return getAzureNodePoolSettings; } /** Returns the builder for the settings used for calls to listAzureNodePools. */ public PagedCallSettings.Builder< ListAzureNodePoolsRequest, ListAzureNodePoolsResponse, ListAzureNodePoolsPagedResponse> listAzureNodePoolsSettings() { return listAzureNodePoolsSettings; } /** Returns the builder for the settings used for calls to deleteAzureNodePool. */ public UnaryCallSettings.Builder deleteAzureNodePoolSettings() { return deleteAzureNodePoolSettings; } /** Returns the builder for the settings used for calls to deleteAzureNodePool. */ public OperationCallSettings.Builder deleteAzureNodePoolOperationSettings() { return deleteAzureNodePoolOperationSettings; } /** Returns the builder for the settings used for calls to getAzureOpenIdConfig. */ public UnaryCallSettings.Builder getAzureOpenIdConfigSettings() { return getAzureOpenIdConfigSettings; } /** Returns the builder for the settings used for calls to getAzureJsonWebKeys. */ public UnaryCallSettings.Builder getAzureJsonWebKeysSettings() { return getAzureJsonWebKeysSettings; } /** Returns the builder for the settings used for calls to getAzureServerConfig. */ public UnaryCallSettings.Builder getAzureServerConfigSettings() { return getAzureServerConfigSettings; } @Override public AzureClustersStubSettings build() throws IOException { return new AzureClustersStubSettings(this); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy