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

com.google.cloud.eventarc.v1.stub.GrpcEventarcStub Maven / Gradle / Ivy

Go to download

Eventarc lets you asynchronously deliver events from Google services, SaaS, and your own apps using loosely coupled services that react to state changes.

There is a newer version: 1.54.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.eventarc.v1.stub;

import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListLocationsPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse;
import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse;

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.eventarc.v1.Channel;
import com.google.cloud.eventarc.v1.ChannelConnection;
import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest;
import com.google.cloud.eventarc.v1.CreateChannelRequest;
import com.google.cloud.eventarc.v1.CreateTriggerRequest;
import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest;
import com.google.cloud.eventarc.v1.DeleteChannelRequest;
import com.google.cloud.eventarc.v1.DeleteTriggerRequest;
import com.google.cloud.eventarc.v1.GetChannelConnectionRequest;
import com.google.cloud.eventarc.v1.GetChannelRequest;
import com.google.cloud.eventarc.v1.GetGoogleChannelConfigRequest;
import com.google.cloud.eventarc.v1.GetProviderRequest;
import com.google.cloud.eventarc.v1.GetTriggerRequest;
import com.google.cloud.eventarc.v1.GoogleChannelConfig;
import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest;
import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse;
import com.google.cloud.eventarc.v1.ListChannelsRequest;
import com.google.cloud.eventarc.v1.ListChannelsResponse;
import com.google.cloud.eventarc.v1.ListProvidersRequest;
import com.google.cloud.eventarc.v1.ListProvidersResponse;
import com.google.cloud.eventarc.v1.ListTriggersRequest;
import com.google.cloud.eventarc.v1.ListTriggersResponse;
import com.google.cloud.eventarc.v1.OperationMetadata;
import com.google.cloud.eventarc.v1.Provider;
import com.google.cloud.eventarc.v1.Trigger;
import com.google.cloud.eventarc.v1.UpdateChannelRequest;
import com.google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest;
import com.google.cloud.eventarc.v1.UpdateTriggerRequest;
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.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.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
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 Eventarc service API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") public class GrpcEventarcStub extends EventarcStub { private static final MethodDescriptor getTriggerMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetTrigger") .setRequestMarshaller(ProtoUtils.marshaller(GetTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Trigger.getDefaultInstance())) .build(); private static final MethodDescriptor listTriggersMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListTriggers") .setRequestMarshaller(ProtoUtils.marshaller(ListTriggersRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListTriggersResponse.getDefaultInstance())) .build(); private static final MethodDescriptor createTriggerMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateTrigger") .setRequestMarshaller( ProtoUtils.marshaller(CreateTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor updateTriggerMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateTrigger") .setRequestMarshaller( ProtoUtils.marshaller(UpdateTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor deleteTriggerMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteTrigger") .setRequestMarshaller( ProtoUtils.marshaller(DeleteTriggerRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getChannelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannel") .setRequestMarshaller(ProtoUtils.marshaller(GetChannelRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Channel.getDefaultInstance())) .build(); private static final MethodDescriptor listChannelsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannels") .setRequestMarshaller(ProtoUtils.marshaller(ListChannelsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListChannelsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor createChannelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannel") .setRequestMarshaller( ProtoUtils.marshaller(CreateChannelRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor updateChannelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateChannel") .setRequestMarshaller( ProtoUtils.marshaller(UpdateChannelRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor deleteChannelMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannel") .setRequestMarshaller( ProtoUtils.marshaller(DeleteChannelRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getProviderMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetProvider") .setRequestMarshaller(ProtoUtils.marshaller(GetProviderRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Provider.getDefaultInstance())) .build(); private static final MethodDescriptor listProvidersMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListProviders") .setRequestMarshaller( ProtoUtils.marshaller(ListProvidersRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListProvidersResponse.getDefaultInstance())) .build(); private static final MethodDescriptor getChannelConnectionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannelConnection") .setRequestMarshaller( ProtoUtils.marshaller(GetChannelConnectionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ChannelConnection.getDefaultInstance())) .build(); private static final MethodDescriptor< ListChannelConnectionsRequest, ListChannelConnectionsResponse> listChannelConnectionsMethodDescriptor = MethodDescriptor .newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannelConnections") .setRequestMarshaller( ProtoUtils.marshaller(ListChannelConnectionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListChannelConnectionsResponse.getDefaultInstance())) .build(); private static final MethodDescriptor createChannelConnectionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannelConnection") .setRequestMarshaller( ProtoUtils.marshaller(CreateChannelConnectionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor deleteChannelConnectionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection") .setRequestMarshaller( ProtoUtils.marshaller(DeleteChannelConnectionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); private static final MethodDescriptor getGoogleChannelConfigMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetGoogleChannelConfig") .setRequestMarshaller( ProtoUtils.marshaller(GetGoogleChannelConfigRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(GoogleChannelConfig.getDefaultInstance())) .build(); private static final MethodDescriptor updateGoogleChannelConfigMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateGoogleChannelConfig") .setRequestMarshaller( ProtoUtils.marshaller(UpdateGoogleChannelConfigRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(GoogleChannelConfig.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 static final MethodDescriptor setIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) .build(); private static final MethodDescriptor testIamPermissionsMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") .setRequestMarshaller( ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) .build(); private final UnaryCallable getTriggerCallable; private final UnaryCallable listTriggersCallable; private final UnaryCallable listTriggersPagedCallable; private final UnaryCallable createTriggerCallable; private final OperationCallable createTriggerOperationCallable; private final UnaryCallable updateTriggerCallable; private final OperationCallable updateTriggerOperationCallable; private final UnaryCallable deleteTriggerCallable; private final OperationCallable deleteTriggerOperationCallable; private final UnaryCallable getChannelCallable; private final UnaryCallable listChannelsCallable; private final UnaryCallable listChannelsPagedCallable; private final UnaryCallable createChannelCallable; private final OperationCallable createChannelOperationCallable; private final UnaryCallable updateChannelCallable; private final OperationCallable updateChannelOperationCallable; private final UnaryCallable deleteChannelCallable; private final OperationCallable deleteChannelOperationCallable; private final UnaryCallable getProviderCallable; private final UnaryCallable listProvidersCallable; private final UnaryCallable listProvidersPagedCallable; private final UnaryCallable getChannelConnectionCallable; private final UnaryCallable listChannelConnectionsCallable; private final UnaryCallable listChannelConnectionsPagedCallable; private final UnaryCallable createChannelConnectionCallable; private final OperationCallable< CreateChannelConnectionRequest, ChannelConnection, OperationMetadata> createChannelConnectionOperationCallable; private final UnaryCallable deleteChannelConnectionCallable; private final OperationCallable< DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> deleteChannelConnectionOperationCallable; private final UnaryCallable getGoogleChannelConfigCallable; private final UnaryCallable updateGoogleChannelConfigCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; private final UnaryCallable getLocationCallable; private final UnaryCallable setIamPolicyCallable; private final UnaryCallable getIamPolicyCallable; private final UnaryCallable testIamPermissionsCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcEventarcStub create(EventarcStubSettings settings) throws IOException { return new GrpcEventarcStub(settings, ClientContext.create(settings)); } public static final GrpcEventarcStub create(ClientContext clientContext) throws IOException { return new GrpcEventarcStub(EventarcStubSettings.newBuilder().build(), clientContext); } public static final GrpcEventarcStub create( ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { return new GrpcEventarcStub( EventarcStubSettings.newBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of GrpcEventarcStub, 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 GrpcEventarcStub(EventarcStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEventarcCallableFactory()); } /** * Constructs an instance of GrpcEventarcStub, 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 GrpcEventarcStub( EventarcStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings getTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getTriggerMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listTriggersTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listTriggersMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings createTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createTriggerMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings updateTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateTriggerMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("trigger.name", String.valueOf(request.getTrigger().getName())); return builder.build(); }) .build(); GrpcCallSettings deleteTriggerTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteTriggerMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings getChannelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getChannelMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listChannelsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listChannelsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings createChannelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createChannelMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings updateChannelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateChannelMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("channel.name", String.valueOf(request.getChannel().getName())); return builder.build(); }) .build(); GrpcCallSettings deleteChannelTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteChannelMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings getProviderTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getProviderMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listProvidersTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listProvidersMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings getChannelConnectionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getChannelConnectionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings listChannelConnectionsTransportSettings = GrpcCallSettings .newBuilder() .setMethodDescriptor(listChannelConnectionsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings createChannelConnectionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createChannelConnectionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); GrpcCallSettings deleteChannelConnectionTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteChannelConnectionMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings getGoogleChannelConfigTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getGoogleChannelConfigMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); GrpcCallSettings updateGoogleChannelConfigTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateGoogleChannelConfigMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "google_channel_config.name", String.valueOf(request.getGoogleChannelConfig().getName())); 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(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); 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 testIamPermissionsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); this.getTriggerCallable = callableFactory.createUnaryCallable( getTriggerTransportSettings, settings.getTriggerSettings(), clientContext); this.listTriggersCallable = callableFactory.createUnaryCallable( listTriggersTransportSettings, settings.listTriggersSettings(), clientContext); this.listTriggersPagedCallable = callableFactory.createPagedCallable( listTriggersTransportSettings, settings.listTriggersSettings(), clientContext); this.createTriggerCallable = callableFactory.createUnaryCallable( createTriggerTransportSettings, settings.createTriggerSettings(), clientContext); this.createTriggerOperationCallable = callableFactory.createOperationCallable( createTriggerTransportSettings, settings.createTriggerOperationSettings(), clientContext, operationsStub); this.updateTriggerCallable = callableFactory.createUnaryCallable( updateTriggerTransportSettings, settings.updateTriggerSettings(), clientContext); this.updateTriggerOperationCallable = callableFactory.createOperationCallable( updateTriggerTransportSettings, settings.updateTriggerOperationSettings(), clientContext, operationsStub); this.deleteTriggerCallable = callableFactory.createUnaryCallable( deleteTriggerTransportSettings, settings.deleteTriggerSettings(), clientContext); this.deleteTriggerOperationCallable = callableFactory.createOperationCallable( deleteTriggerTransportSettings, settings.deleteTriggerOperationSettings(), clientContext, operationsStub); this.getChannelCallable = callableFactory.createUnaryCallable( getChannelTransportSettings, settings.getChannelSettings(), clientContext); this.listChannelsCallable = callableFactory.createUnaryCallable( listChannelsTransportSettings, settings.listChannelsSettings(), clientContext); this.listChannelsPagedCallable = callableFactory.createPagedCallable( listChannelsTransportSettings, settings.listChannelsSettings(), clientContext); this.createChannelCallable = callableFactory.createUnaryCallable( createChannelTransportSettings, settings.createChannelSettings(), clientContext); this.createChannelOperationCallable = callableFactory.createOperationCallable( createChannelTransportSettings, settings.createChannelOperationSettings(), clientContext, operationsStub); this.updateChannelCallable = callableFactory.createUnaryCallable( updateChannelTransportSettings, settings.updateChannelSettings(), clientContext); this.updateChannelOperationCallable = callableFactory.createOperationCallable( updateChannelTransportSettings, settings.updateChannelOperationSettings(), clientContext, operationsStub); this.deleteChannelCallable = callableFactory.createUnaryCallable( deleteChannelTransportSettings, settings.deleteChannelSettings(), clientContext); this.deleteChannelOperationCallable = callableFactory.createOperationCallable( deleteChannelTransportSettings, settings.deleteChannelOperationSettings(), clientContext, operationsStub); this.getProviderCallable = callableFactory.createUnaryCallable( getProviderTransportSettings, settings.getProviderSettings(), clientContext); this.listProvidersCallable = callableFactory.createUnaryCallable( listProvidersTransportSettings, settings.listProvidersSettings(), clientContext); this.listProvidersPagedCallable = callableFactory.createPagedCallable( listProvidersTransportSettings, settings.listProvidersSettings(), clientContext); this.getChannelConnectionCallable = callableFactory.createUnaryCallable( getChannelConnectionTransportSettings, settings.getChannelConnectionSettings(), clientContext); this.listChannelConnectionsCallable = callableFactory.createUnaryCallable( listChannelConnectionsTransportSettings, settings.listChannelConnectionsSettings(), clientContext); this.listChannelConnectionsPagedCallable = callableFactory.createPagedCallable( listChannelConnectionsTransportSettings, settings.listChannelConnectionsSettings(), clientContext); this.createChannelConnectionCallable = callableFactory.createUnaryCallable( createChannelConnectionTransportSettings, settings.createChannelConnectionSettings(), clientContext); this.createChannelConnectionOperationCallable = callableFactory.createOperationCallable( createChannelConnectionTransportSettings, settings.createChannelConnectionOperationSettings(), clientContext, operationsStub); this.deleteChannelConnectionCallable = callableFactory.createUnaryCallable( deleteChannelConnectionTransportSettings, settings.deleteChannelConnectionSettings(), clientContext); this.deleteChannelConnectionOperationCallable = callableFactory.createOperationCallable( deleteChannelConnectionTransportSettings, settings.deleteChannelConnectionOperationSettings(), clientContext, operationsStub); this.getGoogleChannelConfigCallable = callableFactory.createUnaryCallable( getGoogleChannelConfigTransportSettings, settings.getGoogleChannelConfigSettings(), clientContext); this.updateGoogleChannelConfigCallable = callableFactory.createUnaryCallable( updateGoogleChannelConfigTransportSettings, settings.updateGoogleChannelConfigSettings(), 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.setIamPolicyCallable = callableFactory.createUnaryCallable( setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); this.getIamPolicyCallable = callableFactory.createUnaryCallable( getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); this.testIamPermissionsCallable = callableFactory.createUnaryCallable( testIamPermissionsTransportSettings, settings.testIamPermissionsSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } public GrpcOperationsStub getOperationsStub() { return operationsStub; } @Override public UnaryCallable getTriggerCallable() { return getTriggerCallable; } @Override public UnaryCallable listTriggersCallable() { return listTriggersCallable; } @Override public UnaryCallable listTriggersPagedCallable() { return listTriggersPagedCallable; } @Override public UnaryCallable createTriggerCallable() { return createTriggerCallable; } @Override public OperationCallable createTriggerOperationCallable() { return createTriggerOperationCallable; } @Override public UnaryCallable updateTriggerCallable() { return updateTriggerCallable; } @Override public OperationCallable updateTriggerOperationCallable() { return updateTriggerOperationCallable; } @Override public UnaryCallable deleteTriggerCallable() { return deleteTriggerCallable; } @Override public OperationCallable deleteTriggerOperationCallable() { return deleteTriggerOperationCallable; } @Override public UnaryCallable getChannelCallable() { return getChannelCallable; } @Override public UnaryCallable listChannelsCallable() { return listChannelsCallable; } @Override public UnaryCallable listChannelsPagedCallable() { return listChannelsPagedCallable; } @Override public UnaryCallable createChannelCallable() { return createChannelCallable; } @Override public OperationCallable createChannelOperationCallable() { return createChannelOperationCallable; } @Override public UnaryCallable updateChannelCallable() { return updateChannelCallable; } @Override public OperationCallable updateChannelOperationCallable() { return updateChannelOperationCallable; } @Override public UnaryCallable deleteChannelCallable() { return deleteChannelCallable; } @Override public OperationCallable deleteChannelOperationCallable() { return deleteChannelOperationCallable; } @Override public UnaryCallable getProviderCallable() { return getProviderCallable; } @Override public UnaryCallable listProvidersCallable() { return listProvidersCallable; } @Override public UnaryCallable listProvidersPagedCallable() { return listProvidersPagedCallable; } @Override public UnaryCallable getChannelConnectionCallable() { return getChannelConnectionCallable; } @Override public UnaryCallable listChannelConnectionsCallable() { return listChannelConnectionsCallable; } @Override public UnaryCallable listChannelConnectionsPagedCallable() { return listChannelConnectionsPagedCallable; } @Override public UnaryCallable createChannelConnectionCallable() { return createChannelConnectionCallable; } @Override public OperationCallable createChannelConnectionOperationCallable() { return createChannelConnectionOperationCallable; } @Override public UnaryCallable deleteChannelConnectionCallable() { return deleteChannelConnectionCallable; } @Override public OperationCallable deleteChannelConnectionOperationCallable() { return deleteChannelConnectionOperationCallable; } @Override public UnaryCallable getGoogleChannelConfigCallable() { return getGoogleChannelConfigCallable; } @Override public UnaryCallable updateGoogleChannelConfigCallable() { return updateGoogleChannelConfigCallable; } @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; } @Override public UnaryCallable listLocationsPagedCallable() { return listLocationsPagedCallable; } @Override public UnaryCallable getLocationCallable() { return getLocationCallable; } @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; } @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); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy