com.google.cloud.gkemulticloud.v1.stub.GrpcAzureClustersStub Maven / Gradle / Ivy
Show all versions of google-cloud-gke-multi-cloud Show documentation
/*
* 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.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
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.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* gRPC stub implementation for the AzureClusters service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class GrpcAzureClustersStub extends AzureClustersStub {
private static final MethodDescriptor
createAzureClientMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/CreateAzureClient")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateAzureClientRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getAzureClientMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureClient")
.setRequestMarshaller(
ProtoUtils.marshaller(GetAzureClientRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AzureClient.getDefaultInstance()))
.build();
private static final MethodDescriptor
listAzureClientsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/ListAzureClients")
.setRequestMarshaller(
ProtoUtils.marshaller(ListAzureClientsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListAzureClientsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteAzureClientMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/DeleteAzureClient")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteAzureClientRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
createAzureClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/CreateAzureCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateAzureClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateAzureClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/UpdateAzureCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateAzureClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getAzureClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(GetAzureClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AzureCluster.getDefaultInstance()))
.build();
private static final MethodDescriptor
listAzureClustersMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/ListAzureClusters")
.setRequestMarshaller(
ProtoUtils.marshaller(ListAzureClustersRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListAzureClustersResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteAzureClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/DeleteAzureCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteAzureClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor<
GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse>
generateAzureClusterAgentTokenMethodDescriptor =
MethodDescriptor
.
newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AzureClusters/GenerateAzureClusterAgentToken")
.setRequestMarshaller(
ProtoUtils.marshaller(GenerateAzureClusterAgentTokenRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(
GenerateAzureClusterAgentTokenResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor<
GenerateAzureAccessTokenRequest, GenerateAzureAccessTokenResponse>
generateAzureAccessTokenMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AzureClusters/GenerateAzureAccessToken")
.setRequestMarshaller(
ProtoUtils.marshaller(GenerateAzureAccessTokenRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(GenerateAzureAccessTokenResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
createAzureNodePoolMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/CreateAzureNodePool")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateAzureNodePoolRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateAzureNodePoolMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/UpdateAzureNodePool")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateAzureNodePoolRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getAzureNodePoolMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureNodePool")
.setRequestMarshaller(
ProtoUtils.marshaller(GetAzureNodePoolRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AzureNodePool.getDefaultInstance()))
.build();
private static final MethodDescriptor
listAzureNodePoolsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/ListAzureNodePools")
.setRequestMarshaller(
ProtoUtils.marshaller(ListAzureNodePoolsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListAzureNodePoolsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteAzureNodePoolMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/DeleteAzureNodePool")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteAzureNodePoolRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getAzureOpenIdConfigMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureOpenIdConfig")
.setRequestMarshaller(
ProtoUtils.marshaller(GetAzureOpenIdConfigRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AzureOpenIdConfig.getDefaultInstance()))
.build();
private static final MethodDescriptor
getAzureJsonWebKeysMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureJsonWebKeys")
.setRequestMarshaller(
ProtoUtils.marshaller(GetAzureJsonWebKeysRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AzureJsonWebKeys.getDefaultInstance()))
.build();
private static final MethodDescriptor
getAzureServerConfigMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.gkemulticloud.v1.AzureClusters/GetAzureServerConfig")
.setRequestMarshaller(
ProtoUtils.marshaller(GetAzureServerConfigRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(AzureServerConfig.getDefaultInstance()))
.build();
private final UnaryCallable createAzureClientCallable;
private final OperationCallable
createAzureClientOperationCallable;
private final UnaryCallable getAzureClientCallable;
private final UnaryCallable
listAzureClientsCallable;
private final UnaryCallable
listAzureClientsPagedCallable;
private final UnaryCallable deleteAzureClientCallable;
private final OperationCallable
deleteAzureClientOperationCallable;
private final UnaryCallable createAzureClusterCallable;
private final OperationCallable
createAzureClusterOperationCallable;
private final UnaryCallable updateAzureClusterCallable;
private final OperationCallable
updateAzureClusterOperationCallable;
private final UnaryCallable getAzureClusterCallable;
private final UnaryCallable
listAzureClustersCallable;
private final UnaryCallable
listAzureClustersPagedCallable;
private final UnaryCallable deleteAzureClusterCallable;
private final OperationCallable
deleteAzureClusterOperationCallable;
private final UnaryCallable<
GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse>
generateAzureClusterAgentTokenCallable;
private final UnaryCallable
generateAzureAccessTokenCallable;
private final UnaryCallable createAzureNodePoolCallable;
private final OperationCallable
createAzureNodePoolOperationCallable;
private final UnaryCallable updateAzureNodePoolCallable;
private final OperationCallable
updateAzureNodePoolOperationCallable;
private final UnaryCallable getAzureNodePoolCallable;
private final UnaryCallable
listAzureNodePoolsCallable;
private final UnaryCallable
listAzureNodePoolsPagedCallable;
private final UnaryCallable deleteAzureNodePoolCallable;
private final OperationCallable
deleteAzureNodePoolOperationCallable;
private final UnaryCallable
getAzureOpenIdConfigCallable;
private final UnaryCallable
getAzureJsonWebKeysCallable;
private final UnaryCallable
getAzureServerConfigCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcAzureClustersStub create(AzureClustersStubSettings settings)
throws IOException {
return new GrpcAzureClustersStub(settings, ClientContext.create(settings));
}
public static final GrpcAzureClustersStub create(ClientContext clientContext) throws IOException {
return new GrpcAzureClustersStub(AzureClustersStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcAzureClustersStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcAzureClustersStub(
AzureClustersStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcAzureClustersStub, using the given settings. This is protected so
* that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected GrpcAzureClustersStub(AzureClustersStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new GrpcAzureClustersCallableFactory());
}
/**
* Constructs an instance of GrpcAzureClustersStub, using the given settings. This is protected so
* that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected GrpcAzureClustersStub(
AzureClustersStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings createAzureClientTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createAzureClientMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getAzureClientTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAzureClientMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listAzureClientsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listAzureClientsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings deleteAzureClientTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteAzureClientMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createAzureClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createAzureClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateAzureClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateAzureClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"azure_cluster.name", String.valueOf(request.getAzureCluster().getName()));
return builder.build();
})
.build();
GrpcCallSettings getAzureClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAzureClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listAzureClustersTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listAzureClustersMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings deleteAzureClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteAzureClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
generateAzureClusterAgentTokenTransportSettings =
GrpcCallSettings
.
newBuilder()
.setMethodDescriptor(generateAzureClusterAgentTokenMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("azure_cluster", String.valueOf(request.getAzureCluster()));
return builder.build();
})
.build();
GrpcCallSettings
generateAzureAccessTokenTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(generateAzureAccessTokenMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("azure_cluster", String.valueOf(request.getAzureCluster()));
return builder.build();
})
.build();
GrpcCallSettings createAzureNodePoolTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createAzureNodePoolMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateAzureNodePoolTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateAzureNodePoolMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"azure_node_pool.name", String.valueOf(request.getAzureNodePool().getName()));
return builder.build();
})
.build();
GrpcCallSettings getAzureNodePoolTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAzureNodePoolMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
listAzureNodePoolsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listAzureNodePoolsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings deleteAzureNodePoolTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteAzureNodePoolMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings
getAzureOpenIdConfigTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAzureOpenIdConfigMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("azure_cluster", String.valueOf(request.getAzureCluster()));
return builder.build();
})
.build();
GrpcCallSettings
getAzureJsonWebKeysTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAzureJsonWebKeysMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("azure_cluster", String.valueOf(request.getAzureCluster()));
return builder.build();
})
.build();
GrpcCallSettings
getAzureServerConfigTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getAzureServerConfigMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
this.createAzureClientCallable =
callableFactory.createUnaryCallable(
createAzureClientTransportSettings,
settings.createAzureClientSettings(),
clientContext);
this.createAzureClientOperationCallable =
callableFactory.createOperationCallable(
createAzureClientTransportSettings,
settings.createAzureClientOperationSettings(),
clientContext,
operationsStub);
this.getAzureClientCallable =
callableFactory.createUnaryCallable(
getAzureClientTransportSettings, settings.getAzureClientSettings(), clientContext);
this.listAzureClientsCallable =
callableFactory.createUnaryCallable(
listAzureClientsTransportSettings, settings.listAzureClientsSettings(), clientContext);
this.listAzureClientsPagedCallable =
callableFactory.createPagedCallable(
listAzureClientsTransportSettings, settings.listAzureClientsSettings(), clientContext);
this.deleteAzureClientCallable =
callableFactory.createUnaryCallable(
deleteAzureClientTransportSettings,
settings.deleteAzureClientSettings(),
clientContext);
this.deleteAzureClientOperationCallable =
callableFactory.createOperationCallable(
deleteAzureClientTransportSettings,
settings.deleteAzureClientOperationSettings(),
clientContext,
operationsStub);
this.createAzureClusterCallable =
callableFactory.createUnaryCallable(
createAzureClusterTransportSettings,
settings.createAzureClusterSettings(),
clientContext);
this.createAzureClusterOperationCallable =
callableFactory.createOperationCallable(
createAzureClusterTransportSettings,
settings.createAzureClusterOperationSettings(),
clientContext,
operationsStub);
this.updateAzureClusterCallable =
callableFactory.createUnaryCallable(
updateAzureClusterTransportSettings,
settings.updateAzureClusterSettings(),
clientContext);
this.updateAzureClusterOperationCallable =
callableFactory.createOperationCallable(
updateAzureClusterTransportSettings,
settings.updateAzureClusterOperationSettings(),
clientContext,
operationsStub);
this.getAzureClusterCallable =
callableFactory.createUnaryCallable(
getAzureClusterTransportSettings, settings.getAzureClusterSettings(), clientContext);
this.listAzureClustersCallable =
callableFactory.createUnaryCallable(
listAzureClustersTransportSettings,
settings.listAzureClustersSettings(),
clientContext);
this.listAzureClustersPagedCallable =
callableFactory.createPagedCallable(
listAzureClustersTransportSettings,
settings.listAzureClustersSettings(),
clientContext);
this.deleteAzureClusterCallable =
callableFactory.createUnaryCallable(
deleteAzureClusterTransportSettings,
settings.deleteAzureClusterSettings(),
clientContext);
this.deleteAzureClusterOperationCallable =
callableFactory.createOperationCallable(
deleteAzureClusterTransportSettings,
settings.deleteAzureClusterOperationSettings(),
clientContext,
operationsStub);
this.generateAzureClusterAgentTokenCallable =
callableFactory.createUnaryCallable(
generateAzureClusterAgentTokenTransportSettings,
settings.generateAzureClusterAgentTokenSettings(),
clientContext);
this.generateAzureAccessTokenCallable =
callableFactory.createUnaryCallable(
generateAzureAccessTokenTransportSettings,
settings.generateAzureAccessTokenSettings(),
clientContext);
this.createAzureNodePoolCallable =
callableFactory.createUnaryCallable(
createAzureNodePoolTransportSettings,
settings.createAzureNodePoolSettings(),
clientContext);
this.createAzureNodePoolOperationCallable =
callableFactory.createOperationCallable(
createAzureNodePoolTransportSettings,
settings.createAzureNodePoolOperationSettings(),
clientContext,
operationsStub);
this.updateAzureNodePoolCallable =
callableFactory.createUnaryCallable(
updateAzureNodePoolTransportSettings,
settings.updateAzureNodePoolSettings(),
clientContext);
this.updateAzureNodePoolOperationCallable =
callableFactory.createOperationCallable(
updateAzureNodePoolTransportSettings,
settings.updateAzureNodePoolOperationSettings(),
clientContext,
operationsStub);
this.getAzureNodePoolCallable =
callableFactory.createUnaryCallable(
getAzureNodePoolTransportSettings, settings.getAzureNodePoolSettings(), clientContext);
this.listAzureNodePoolsCallable =
callableFactory.createUnaryCallable(
listAzureNodePoolsTransportSettings,
settings.listAzureNodePoolsSettings(),
clientContext);
this.listAzureNodePoolsPagedCallable =
callableFactory.createPagedCallable(
listAzureNodePoolsTransportSettings,
settings.listAzureNodePoolsSettings(),
clientContext);
this.deleteAzureNodePoolCallable =
callableFactory.createUnaryCallable(
deleteAzureNodePoolTransportSettings,
settings.deleteAzureNodePoolSettings(),
clientContext);
this.deleteAzureNodePoolOperationCallable =
callableFactory.createOperationCallable(
deleteAzureNodePoolTransportSettings,
settings.deleteAzureNodePoolOperationSettings(),
clientContext,
operationsStub);
this.getAzureOpenIdConfigCallable =
callableFactory.createUnaryCallable(
getAzureOpenIdConfigTransportSettings,
settings.getAzureOpenIdConfigSettings(),
clientContext);
this.getAzureJsonWebKeysCallable =
callableFactory.createUnaryCallable(
getAzureJsonWebKeysTransportSettings,
settings.getAzureJsonWebKeysSettings(),
clientContext);
this.getAzureServerConfigCallable =
callableFactory.createUnaryCallable(
getAzureServerConfigTransportSettings,
settings.getAzureServerConfigSettings(),
clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable createAzureClientCallable() {
return createAzureClientCallable;
}
@Override
public OperationCallable
createAzureClientOperationCallable() {
return createAzureClientOperationCallable;
}
@Override
public UnaryCallable getAzureClientCallable() {
return getAzureClientCallable;
}
@Override
public UnaryCallable
listAzureClientsCallable() {
return listAzureClientsCallable;
}
@Override
public UnaryCallable
listAzureClientsPagedCallable() {
return listAzureClientsPagedCallable;
}
@Override
public UnaryCallable deleteAzureClientCallable() {
return deleteAzureClientCallable;
}
@Override
public OperationCallable
deleteAzureClientOperationCallable() {
return deleteAzureClientOperationCallable;
}
@Override
public UnaryCallable createAzureClusterCallable() {
return createAzureClusterCallable;
}
@Override
public OperationCallable
createAzureClusterOperationCallable() {
return createAzureClusterOperationCallable;
}
@Override
public UnaryCallable updateAzureClusterCallable() {
return updateAzureClusterCallable;
}
@Override
public OperationCallable
updateAzureClusterOperationCallable() {
return updateAzureClusterOperationCallable;
}
@Override
public UnaryCallable getAzureClusterCallable() {
return getAzureClusterCallable;
}
@Override
public UnaryCallable
listAzureClustersCallable() {
return listAzureClustersCallable;
}
@Override
public UnaryCallable
listAzureClustersPagedCallable() {
return listAzureClustersPagedCallable;
}
@Override
public UnaryCallable deleteAzureClusterCallable() {
return deleteAzureClusterCallable;
}
@Override
public OperationCallable
deleteAzureClusterOperationCallable() {
return deleteAzureClusterOperationCallable;
}
@Override
public UnaryCallable<
GenerateAzureClusterAgentTokenRequest, GenerateAzureClusterAgentTokenResponse>
generateAzureClusterAgentTokenCallable() {
return generateAzureClusterAgentTokenCallable;
}
@Override
public UnaryCallable
generateAzureAccessTokenCallable() {
return generateAzureAccessTokenCallable;
}
@Override
public UnaryCallable createAzureNodePoolCallable() {
return createAzureNodePoolCallable;
}
@Override
public OperationCallable
createAzureNodePoolOperationCallable() {
return createAzureNodePoolOperationCallable;
}
@Override
public UnaryCallable updateAzureNodePoolCallable() {
return updateAzureNodePoolCallable;
}
@Override
public OperationCallable
updateAzureNodePoolOperationCallable() {
return updateAzureNodePoolOperationCallable;
}
@Override
public UnaryCallable getAzureNodePoolCallable() {
return getAzureNodePoolCallable;
}
@Override
public UnaryCallable
listAzureNodePoolsCallable() {
return listAzureNodePoolsCallable;
}
@Override
public UnaryCallable
listAzureNodePoolsPagedCallable() {
return listAzureNodePoolsPagedCallable;
}
@Override
public UnaryCallable deleteAzureNodePoolCallable() {
return deleteAzureNodePoolCallable;
}
@Override
public OperationCallable
deleteAzureNodePoolOperationCallable() {
return deleteAzureNodePoolOperationCallable;
}
@Override
public UnaryCallable
getAzureOpenIdConfigCallable() {
return getAzureOpenIdConfigCallable;
}
@Override
public UnaryCallable getAzureJsonWebKeysCallable() {
return getAzureJsonWebKeysCallable;
}
@Override
public UnaryCallable
getAzureServerConfigCallable() {
return getAzureServerConfigCallable;
}
@Override
public final void close() {
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}
@Override
public void shutdown() {
backgroundResources.shutdown();
}
@Override
public boolean isShutdown() {
return backgroundResources.isShutdown();
}
@Override
public boolean isTerminated() {
return backgroundResources.isTerminated();
}
@Override
public void shutdownNow() {
backgroundResources.shutdownNow();
}
@Override
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return backgroundResources.awaitTermination(duration, unit);
}
}