com.google.cloud.gkemulticloud.v1.stub.HttpJsonAttachedClustersStub 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.AttachedClustersClient.ListAttachedClustersPagedResponse;
import com.google.api.HttpRule;
import com.google.api.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.httpjson.ApiMethodDescriptor;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
import com.google.api.gax.httpjson.ProtoMessageResponseParser;
import com.google.api.gax.httpjson.ProtoRestSerializer;
import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
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.AttachedCluster;
import com.google.cloud.gkemulticloud.v1.AttachedServerConfig;
import com.google.cloud.gkemulticloud.v1.CreateAttachedClusterRequest;
import com.google.cloud.gkemulticloud.v1.DeleteAttachedClusterRequest;
import com.google.cloud.gkemulticloud.v1.GenerateAttachedClusterAgentTokenRequest;
import com.google.cloud.gkemulticloud.v1.GenerateAttachedClusterAgentTokenResponse;
import com.google.cloud.gkemulticloud.v1.GenerateAttachedClusterInstallManifestRequest;
import com.google.cloud.gkemulticloud.v1.GenerateAttachedClusterInstallManifestResponse;
import com.google.cloud.gkemulticloud.v1.GetAttachedClusterRequest;
import com.google.cloud.gkemulticloud.v1.GetAttachedServerConfigRequest;
import com.google.cloud.gkemulticloud.v1.ImportAttachedClusterRequest;
import com.google.cloud.gkemulticloud.v1.ListAttachedClustersRequest;
import com.google.cloud.gkemulticloud.v1.ListAttachedClustersResponse;
import com.google.cloud.gkemulticloud.v1.OperationMetadata;
import com.google.cloud.gkemulticloud.v1.UpdateAttachedClusterRequest;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* REST stub implementation for the AttachedClusters service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class HttpJsonAttachedClustersStub extends AttachedClustersStub {
private static final TypeRegistry typeRegistry =
TypeRegistry.newBuilder()
.add(AttachedCluster.getDescriptor())
.add(OperationMetadata.getDescriptor())
.add(Empty.getDescriptor())
.build();
private static final ApiMethodDescriptor
createAttachedClusterMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/CreateAttachedCluster")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{parent=projects/*/locations/*}/attachedClusters",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(
fields, "attachedClusterId", request.getAttachedClusterId());
serializer.putQueryParam(
fields, "validateOnly", request.getValidateOnly());
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("attachedCluster", request.getAttachedCluster(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreateAttachedClusterRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
updateAttachedClusterMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/UpdateAttachedCluster")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{attachedCluster.name=projects/*/locations/*/attachedClusters/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(
fields,
"attachedCluster.name",
request.getAttachedCluster().getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(
fields, "validateOnly", request.getValidateOnly());
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("attachedCluster", request.getAttachedCluster(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(UpdateAttachedClusterRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
importAttachedClusterMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/ImportAttachedCluster")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{parent=projects/*/locations/*}/attachedClusters:import",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), false))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(ImportAttachedClusterRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
getAttachedClusterMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/GetAttachedCluster")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{name=projects/*/locations/*/attachedClusters/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(AttachedCluster.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor<
ListAttachedClustersRequest, ListAttachedClustersResponse>
listAttachedClustersMethodDescriptor =
ApiMethodDescriptor
.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/ListAttachedClusters")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{parent=projects/*/locations/*}/attachedClusters",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListAttachedClustersResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
deleteAttachedClusterMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/DeleteAttachedCluster")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{name=projects/*/locations/*/attachedClusters/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(
fields, "allowMissing", request.getAllowMissing());
serializer.putQueryParam(fields, "etag", request.getEtag());
serializer.putQueryParam(
fields, "ignoreErrors", request.getIgnoreErrors());
serializer.putQueryParam(
fields, "validateOnly", request.getValidateOnly());
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeleteAttachedClusterRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
getAttachedServerConfigMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/GetAttachedServerConfig")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1/{name=projects/*/locations/*/attachedServerConfig}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(AttachedServerConfig.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor<
GenerateAttachedClusterInstallManifestRequest,
GenerateAttachedClusterInstallManifestResponse>
generateAttachedClusterInstallManifestMethodDescriptor =
ApiMethodDescriptor
.
newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/GenerateAttachedClusterInstallManifest")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter
.newBuilder()
.setPath(
"/v1/{parent=projects/*/locations/*}:generateAttachedClusterInstallManifest",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer
serializer = ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer
serializer = ProtoRestSerializer.create();
serializer.putQueryParam(
fields, "attachedClusterId", request.getAttachedClusterId());
serializer.putQueryParam(
fields, "platformVersion", request.getPlatformVersion());
serializer.putQueryParam(
fields, "proxyConfig", request.getProxyConfig());
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser
.newBuilder()
.setDefaultInstance(
GenerateAttachedClusterInstallManifestResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenMethodDescriptor =
ApiMethodDescriptor
.
newBuilder()
.setFullMethodName(
"google.cloud.gkemulticloud.v1.AttachedClusters/GenerateAttachedClusterAgentToken")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter
.newBuilder()
.setPath(
"/v1/{attachedCluster=projects/*/locations/*/attachedClusters/*}:generateAttachedClusterAgentToken",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer
serializer = ProtoRestSerializer.create();
serializer.putPathParam(
fields, "attachedCluster", request.getAttachedCluster());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer
serializer = ProtoRestSerializer.create();
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
"*",
request.toBuilder().clearAttachedCluster().build(),
false))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(
GenerateAttachedClusterAgentTokenResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private final UnaryCallable
createAttachedClusterCallable;
private final OperationCallable
createAttachedClusterOperationCallable;
private final UnaryCallable
updateAttachedClusterCallable;
private final OperationCallable
updateAttachedClusterOperationCallable;
private final UnaryCallable
importAttachedClusterCallable;
private final OperationCallable
importAttachedClusterOperationCallable;
private final UnaryCallable
getAttachedClusterCallable;
private final UnaryCallable
listAttachedClustersCallable;
private final UnaryCallable
listAttachedClustersPagedCallable;
private final UnaryCallable
deleteAttachedClusterCallable;
private final OperationCallable
deleteAttachedClusterOperationCallable;
private final UnaryCallable
getAttachedServerConfigCallable;
private final UnaryCallable<
GenerateAttachedClusterInstallManifestRequest,
GenerateAttachedClusterInstallManifestResponse>
generateAttachedClusterInstallManifestCallable;
private final UnaryCallable<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenCallable;
private final BackgroundResource backgroundResources;
private final HttpJsonOperationsStub httpJsonOperationsStub;
private final HttpJsonStubCallableFactory callableFactory;
public static final HttpJsonAttachedClustersStub create(AttachedClustersStubSettings settings)
throws IOException {
return new HttpJsonAttachedClustersStub(settings, ClientContext.create(settings));
}
public static final HttpJsonAttachedClustersStub create(ClientContext clientContext)
throws IOException {
return new HttpJsonAttachedClustersStub(
AttachedClustersStubSettings.newHttpJsonBuilder().build(), clientContext);
}
public static final HttpJsonAttachedClustersStub create(
ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
return new HttpJsonAttachedClustersStub(
AttachedClustersStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of HttpJsonAttachedClustersStub, 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 HttpJsonAttachedClustersStub(
AttachedClustersStubSettings settings, ClientContext clientContext) throws IOException {
this(settings, clientContext, new HttpJsonAttachedClustersCallableFactory());
}
/**
* Constructs an instance of HttpJsonAttachedClustersStub, 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 HttpJsonAttachedClustersStub(
AttachedClustersStubSettings settings,
ClientContext clientContext,
HttpJsonStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.httpJsonOperationsStub =
HttpJsonOperationsStub.create(
clientContext,
callableFactory,
typeRegistry,
ImmutableMap.builder()
.put(
"google.longrunning.Operations.CancelOperation",
HttpRule.newBuilder()
.setPost("/v1/{name=projects/*/locations/*/operations/*}:cancel")
.build())
.put(
"google.longrunning.Operations.DeleteOperation",
HttpRule.newBuilder()
.setDelete("/v1/{name=projects/*/locations/*/operations/*}")
.build())
.put(
"google.longrunning.Operations.GetOperation",
HttpRule.newBuilder()
.setGet("/v1/{name=projects/*/locations/*/operations/*}")
.build())
.put(
"google.longrunning.Operations.ListOperations",
HttpRule.newBuilder()
.setGet("/v1/{name=projects/*/locations/*}/operations")
.build())
.build());
HttpJsonCallSettings
createAttachedClusterTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createAttachedClusterMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
updateAttachedClusterTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updateAttachedClusterMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"attached_cluster.name",
String.valueOf(request.getAttachedCluster().getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
importAttachedClusterTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(importAttachedClusterMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
getAttachedClusterTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getAttachedClusterMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
listAttachedClustersTransportSettings =
HttpJsonCallSettings
.newBuilder()
.setMethodDescriptor(listAttachedClustersMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
deleteAttachedClusterTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteAttachedClusterMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
getAttachedServerConfigTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getAttachedServerConfigMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings<
GenerateAttachedClusterInstallManifestRequest,
GenerateAttachedClusterInstallManifestResponse>
generateAttachedClusterInstallManifestTransportSettings =
HttpJsonCallSettings
.
newBuilder()
.setMethodDescriptor(generateAttachedClusterInstallManifestMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenTransportSettings =
HttpJsonCallSettings
.
newBuilder()
.setMethodDescriptor(generateAttachedClusterAgentTokenMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("attached_cluster", String.valueOf(request.getAttachedCluster()));
return builder.build();
})
.build();
this.createAttachedClusterCallable =
callableFactory.createUnaryCallable(
createAttachedClusterTransportSettings,
settings.createAttachedClusterSettings(),
clientContext);
this.createAttachedClusterOperationCallable =
callableFactory.createOperationCallable(
createAttachedClusterTransportSettings,
settings.createAttachedClusterOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.updateAttachedClusterCallable =
callableFactory.createUnaryCallable(
updateAttachedClusterTransportSettings,
settings.updateAttachedClusterSettings(),
clientContext);
this.updateAttachedClusterOperationCallable =
callableFactory.createOperationCallable(
updateAttachedClusterTransportSettings,
settings.updateAttachedClusterOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.importAttachedClusterCallable =
callableFactory.createUnaryCallable(
importAttachedClusterTransportSettings,
settings.importAttachedClusterSettings(),
clientContext);
this.importAttachedClusterOperationCallable =
callableFactory.createOperationCallable(
importAttachedClusterTransportSettings,
settings.importAttachedClusterOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.getAttachedClusterCallable =
callableFactory.createUnaryCallable(
getAttachedClusterTransportSettings,
settings.getAttachedClusterSettings(),
clientContext);
this.listAttachedClustersCallable =
callableFactory.createUnaryCallable(
listAttachedClustersTransportSettings,
settings.listAttachedClustersSettings(),
clientContext);
this.listAttachedClustersPagedCallable =
callableFactory.createPagedCallable(
listAttachedClustersTransportSettings,
settings.listAttachedClustersSettings(),
clientContext);
this.deleteAttachedClusterCallable =
callableFactory.createUnaryCallable(
deleteAttachedClusterTransportSettings,
settings.deleteAttachedClusterSettings(),
clientContext);
this.deleteAttachedClusterOperationCallable =
callableFactory.createOperationCallable(
deleteAttachedClusterTransportSettings,
settings.deleteAttachedClusterOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.getAttachedServerConfigCallable =
callableFactory.createUnaryCallable(
getAttachedServerConfigTransportSettings,
settings.getAttachedServerConfigSettings(),
clientContext);
this.generateAttachedClusterInstallManifestCallable =
callableFactory.createUnaryCallable(
generateAttachedClusterInstallManifestTransportSettings,
settings.generateAttachedClusterInstallManifestSettings(),
clientContext);
this.generateAttachedClusterAgentTokenCallable =
callableFactory.createUnaryCallable(
generateAttachedClusterAgentTokenTransportSettings,
settings.generateAttachedClusterAgentTokenSettings(),
clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
@InternalApi
public static List getMethodDescriptors() {
List methodDescriptors = new ArrayList<>();
methodDescriptors.add(createAttachedClusterMethodDescriptor);
methodDescriptors.add(updateAttachedClusterMethodDescriptor);
methodDescriptors.add(importAttachedClusterMethodDescriptor);
methodDescriptors.add(getAttachedClusterMethodDescriptor);
methodDescriptors.add(listAttachedClustersMethodDescriptor);
methodDescriptors.add(deleteAttachedClusterMethodDescriptor);
methodDescriptors.add(getAttachedServerConfigMethodDescriptor);
methodDescriptors.add(generateAttachedClusterInstallManifestMethodDescriptor);
methodDescriptors.add(generateAttachedClusterAgentTokenMethodDescriptor);
return methodDescriptors;
}
public HttpJsonOperationsStub getHttpJsonOperationsStub() {
return httpJsonOperationsStub;
}
@Override
public UnaryCallable createAttachedClusterCallable() {
return createAttachedClusterCallable;
}
@Override
public OperationCallable
createAttachedClusterOperationCallable() {
return createAttachedClusterOperationCallable;
}
@Override
public UnaryCallable updateAttachedClusterCallable() {
return updateAttachedClusterCallable;
}
@Override
public OperationCallable
updateAttachedClusterOperationCallable() {
return updateAttachedClusterOperationCallable;
}
@Override
public UnaryCallable importAttachedClusterCallable() {
return importAttachedClusterCallable;
}
@Override
public OperationCallable
importAttachedClusterOperationCallable() {
return importAttachedClusterOperationCallable;
}
@Override
public UnaryCallable getAttachedClusterCallable() {
return getAttachedClusterCallable;
}
@Override
public UnaryCallable
listAttachedClustersCallable() {
return listAttachedClustersCallable;
}
@Override
public UnaryCallable
listAttachedClustersPagedCallable() {
return listAttachedClustersPagedCallable;
}
@Override
public UnaryCallable deleteAttachedClusterCallable() {
return deleteAttachedClusterCallable;
}
@Override
public OperationCallable
deleteAttachedClusterOperationCallable() {
return deleteAttachedClusterOperationCallable;
}
@Override
public UnaryCallable
getAttachedServerConfigCallable() {
return getAttachedServerConfigCallable;
}
@Override
public UnaryCallable<
GenerateAttachedClusterInstallManifestRequest,
GenerateAttachedClusterInstallManifestResponse>
generateAttachedClusterInstallManifestCallable() {
return generateAttachedClusterInstallManifestCallable;
}
@Override
public UnaryCallable<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenCallable() {
return generateAttachedClusterAgentTokenCallable;
}
@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);
}
}