
com.google.cloud.servicedirectory.v1beta1.stub.GrpcRegistrationServiceStub Maven / Gradle / Ivy
/*
* 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.servicedirectory.v1beta1.stub;
import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListEndpointsPagedResponse;
import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListLocationsPagedResponse;
import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListNamespacesPagedResponse;
import static com.google.cloud.servicedirectory.v1beta1.RegistrationServiceClient.ListServicesPagedResponse;
import com.google.api.core.BetaApi;
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.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
import com.google.cloud.servicedirectory.v1beta1.CreateEndpointRequest;
import com.google.cloud.servicedirectory.v1beta1.CreateNamespaceRequest;
import com.google.cloud.servicedirectory.v1beta1.CreateServiceRequest;
import com.google.cloud.servicedirectory.v1beta1.DeleteEndpointRequest;
import com.google.cloud.servicedirectory.v1beta1.DeleteNamespaceRequest;
import com.google.cloud.servicedirectory.v1beta1.DeleteServiceRequest;
import com.google.cloud.servicedirectory.v1beta1.Endpoint;
import com.google.cloud.servicedirectory.v1beta1.GetEndpointRequest;
import com.google.cloud.servicedirectory.v1beta1.GetNamespaceRequest;
import com.google.cloud.servicedirectory.v1beta1.GetServiceRequest;
import com.google.cloud.servicedirectory.v1beta1.ListEndpointsRequest;
import com.google.cloud.servicedirectory.v1beta1.ListEndpointsResponse;
import com.google.cloud.servicedirectory.v1beta1.ListNamespacesRequest;
import com.google.cloud.servicedirectory.v1beta1.ListNamespacesResponse;
import com.google.cloud.servicedirectory.v1beta1.ListServicesRequest;
import com.google.cloud.servicedirectory.v1beta1.ListServicesResponse;
import com.google.cloud.servicedirectory.v1beta1.Namespace;
import com.google.cloud.servicedirectory.v1beta1.Service;
import com.google.cloud.servicedirectory.v1beta1.UpdateEndpointRequest;
import com.google.cloud.servicedirectory.v1beta1.UpdateNamespaceRequest;
import com.google.cloud.servicedirectory.v1beta1.UpdateServiceRequest;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
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 RegistrationService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@BetaApi
@Generated("by gapic-generator-java")
public class GrpcRegistrationServiceStub extends RegistrationServiceStub {
private static final MethodDescriptor
createNamespaceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/CreateNamespace")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateNamespaceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Namespace.getDefaultInstance()))
.build();
private static final MethodDescriptor
listNamespacesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/ListNamespaces")
.setRequestMarshaller(
ProtoUtils.marshaller(ListNamespacesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListNamespacesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
getNamespaceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/GetNamespace")
.setRequestMarshaller(ProtoUtils.marshaller(GetNamespaceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Namespace.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateNamespaceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateNamespace")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateNamespaceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Namespace.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteNamespaceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteNamespace")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteNamespaceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
createServiceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/CreateService")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateServiceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance()))
.build();
private static final MethodDescriptor
listServicesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/ListServices")
.setRequestMarshaller(ProtoUtils.marshaller(ListServicesRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListServicesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getServiceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.servicedirectory.v1beta1.RegistrationService/GetService")
.setRequestMarshaller(ProtoUtils.marshaller(GetServiceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateServiceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateService")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateServiceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance()))
.build();
private static final MethodDescriptor deleteServiceMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteService")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteServiceRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor
createEndpointMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/CreateEndpoint")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateEndpointRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance()))
.build();
private static final MethodDescriptor
listEndpointsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/ListEndpoints")
.setRequestMarshaller(
ProtoUtils.marshaller(ListEndpointsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListEndpointsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getEndpointMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/GetEndpoint")
.setRequestMarshaller(ProtoUtils.marshaller(GetEndpointRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateEndpointMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/UpdateEndpoint")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateEndpointRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Endpoint.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteEndpointMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/DeleteEndpoint")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteEndpointRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
.build();
private static final MethodDescriptor getIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/GetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();
private static final MethodDescriptor setIamPolicyMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/SetIamPolicy")
.setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance()))
.build();
private static final MethodDescriptor
testIamPermissionsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.servicedirectory.v1beta1.RegistrationService/TestIamPermissions")
.setRequestMarshaller(
ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
listLocationsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.location.Locations/ListLocations")
.setRequestMarshaller(
ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getLocationMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.location.Locations/GetLocation")
.setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
.build();
private final UnaryCallable createNamespaceCallable;
private final UnaryCallable listNamespacesCallable;
private final UnaryCallable
listNamespacesPagedCallable;
private final UnaryCallable getNamespaceCallable;
private final UnaryCallable updateNamespaceCallable;
private final UnaryCallable deleteNamespaceCallable;
private final UnaryCallable createServiceCallable;
private final UnaryCallable listServicesCallable;
private final UnaryCallable
listServicesPagedCallable;
private final UnaryCallable getServiceCallable;
private final UnaryCallable updateServiceCallable;
private final UnaryCallable deleteServiceCallable;
private final UnaryCallable createEndpointCallable;
private final UnaryCallable listEndpointsCallable;
private final UnaryCallable
listEndpointsPagedCallable;
private final UnaryCallable getEndpointCallable;
private final UnaryCallable updateEndpointCallable;
private final UnaryCallable deleteEndpointCallable;
private final UnaryCallable getIamPolicyCallable;
private final UnaryCallable setIamPolicyCallable;
private final UnaryCallable
testIamPermissionsCallable;
private final UnaryCallable listLocationsCallable;
private final UnaryCallable
listLocationsPagedCallable;
private final UnaryCallable getLocationCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcRegistrationServiceStub create(RegistrationServiceStubSettings settings)
throws IOException {
return new GrpcRegistrationServiceStub(settings, ClientContext.create(settings));
}
public static final GrpcRegistrationServiceStub create(ClientContext clientContext)
throws IOException {
return new GrpcRegistrationServiceStub(
RegistrationServiceStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcRegistrationServiceStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcRegistrationServiceStub(
RegistrationServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcRegistrationServiceStub, 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 GrpcRegistrationServiceStub(
RegistrationServiceStubSettings settings, ClientContext clientContext) throws IOException {
this(settings, clientContext, new GrpcRegistrationServiceCallableFactory());
}
/**
* Constructs an instance of GrpcRegistrationServiceStub, 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 GrpcRegistrationServiceStub(
RegistrationServiceStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings createNamespaceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createNamespaceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings
listNamespacesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listNamespacesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getNamespaceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getNamespaceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings updateNamespaceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateNamespaceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("namespace.name", String.valueOf(request.getNamespace().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteNamespaceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteNamespaceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createServiceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createServiceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings listServicesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listServicesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getServiceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getServiceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings updateServiceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateServiceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("service.name", String.valueOf(request.getService().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteServiceTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteServiceMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createEndpointTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createEndpointMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings listEndpointsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listEndpointsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getEndpointTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getEndpointMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings updateEndpointTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateEndpointMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("endpoint.name", String.valueOf(request.getEndpoint().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteEndpointTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteEndpointMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings getIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings setIamPolicyTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(setIamPolicyMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings
testIamPermissionsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(testIamPermissionsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("resource", String.valueOf(request.getResource()));
return builder.build();
})
.build();
GrpcCallSettings listLocationsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listLocationsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings getLocationTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getLocationMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
this.createNamespaceCallable =
callableFactory.createUnaryCallable(
createNamespaceTransportSettings, settings.createNamespaceSettings(), clientContext);
this.listNamespacesCallable =
callableFactory.createUnaryCallable(
listNamespacesTransportSettings, settings.listNamespacesSettings(), clientContext);
this.listNamespacesPagedCallable =
callableFactory.createPagedCallable(
listNamespacesTransportSettings, settings.listNamespacesSettings(), clientContext);
this.getNamespaceCallable =
callableFactory.createUnaryCallable(
getNamespaceTransportSettings, settings.getNamespaceSettings(), clientContext);
this.updateNamespaceCallable =
callableFactory.createUnaryCallable(
updateNamespaceTransportSettings, settings.updateNamespaceSettings(), clientContext);
this.deleteNamespaceCallable =
callableFactory.createUnaryCallable(
deleteNamespaceTransportSettings, settings.deleteNamespaceSettings(), clientContext);
this.createServiceCallable =
callableFactory.createUnaryCallable(
createServiceTransportSettings, settings.createServiceSettings(), clientContext);
this.listServicesCallable =
callableFactory.createUnaryCallable(
listServicesTransportSettings, settings.listServicesSettings(), clientContext);
this.listServicesPagedCallable =
callableFactory.createPagedCallable(
listServicesTransportSettings, settings.listServicesSettings(), clientContext);
this.getServiceCallable =
callableFactory.createUnaryCallable(
getServiceTransportSettings, settings.getServiceSettings(), clientContext);
this.updateServiceCallable =
callableFactory.createUnaryCallable(
updateServiceTransportSettings, settings.updateServiceSettings(), clientContext);
this.deleteServiceCallable =
callableFactory.createUnaryCallable(
deleteServiceTransportSettings, settings.deleteServiceSettings(), clientContext);
this.createEndpointCallable =
callableFactory.createUnaryCallable(
createEndpointTransportSettings, settings.createEndpointSettings(), clientContext);
this.listEndpointsCallable =
callableFactory.createUnaryCallable(
listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext);
this.listEndpointsPagedCallable =
callableFactory.createPagedCallable(
listEndpointsTransportSettings, settings.listEndpointsSettings(), clientContext);
this.getEndpointCallable =
callableFactory.createUnaryCallable(
getEndpointTransportSettings, settings.getEndpointSettings(), clientContext);
this.updateEndpointCallable =
callableFactory.createUnaryCallable(
updateEndpointTransportSettings, settings.updateEndpointSettings(), clientContext);
this.deleteEndpointCallable =
callableFactory.createUnaryCallable(
deleteEndpointTransportSettings, settings.deleteEndpointSettings(), clientContext);
this.getIamPolicyCallable =
callableFactory.createUnaryCallable(
getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext);
this.setIamPolicyCallable =
callableFactory.createUnaryCallable(
setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext);
this.testIamPermissionsCallable =
callableFactory.createUnaryCallable(
testIamPermissionsTransportSettings,
settings.testIamPermissionsSettings(),
clientContext);
this.listLocationsCallable =
callableFactory.createUnaryCallable(
listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
this.listLocationsPagedCallable =
callableFactory.createPagedCallable(
listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
this.getLocationCallable =
callableFactory.createUnaryCallable(
getLocationTransportSettings, settings.getLocationSettings(), clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable createNamespaceCallable() {
return createNamespaceCallable;
}
@Override
public UnaryCallable listNamespacesCallable() {
return listNamespacesCallable;
}
@Override
public UnaryCallable
listNamespacesPagedCallable() {
return listNamespacesPagedCallable;
}
@Override
public UnaryCallable getNamespaceCallable() {
return getNamespaceCallable;
}
@Override
public UnaryCallable updateNamespaceCallable() {
return updateNamespaceCallable;
}
@Override
public UnaryCallable deleteNamespaceCallable() {
return deleteNamespaceCallable;
}
@Override
public UnaryCallable createServiceCallable() {
return createServiceCallable;
}
@Override
public UnaryCallable listServicesCallable() {
return listServicesCallable;
}
@Override
public UnaryCallable listServicesPagedCallable() {
return listServicesPagedCallable;
}
@Override
public UnaryCallable getServiceCallable() {
return getServiceCallable;
}
@Override
public UnaryCallable updateServiceCallable() {
return updateServiceCallable;
}
@Override
public UnaryCallable deleteServiceCallable() {
return deleteServiceCallable;
}
@Override
public UnaryCallable createEndpointCallable() {
return createEndpointCallable;
}
@Override
public UnaryCallable listEndpointsCallable() {
return listEndpointsCallable;
}
@Override
public UnaryCallable
listEndpointsPagedCallable() {
return listEndpointsPagedCallable;
}
@Override
public UnaryCallable getEndpointCallable() {
return getEndpointCallable;
}
@Override
public UnaryCallable updateEndpointCallable() {
return updateEndpointCallable;
}
@Override
public UnaryCallable deleteEndpointCallable() {
return deleteEndpointCallable;
}
@Override
public UnaryCallable getIamPolicyCallable() {
return getIamPolicyCallable;
}
@Override
public UnaryCallable setIamPolicyCallable() {
return setIamPolicyCallable;
}
@Override
public UnaryCallable
testIamPermissionsCallable() {
return testIamPermissionsCallable;
}
@Override
public UnaryCallable listLocationsCallable() {
return listLocationsCallable;
}
@Override
public UnaryCallable
listLocationsPagedCallable() {
return listLocationsPagedCallable;
}
@Override
public UnaryCallable getLocationCallable() {
return getLocationCallable;
}
@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);
}
}