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

com.google.cloud.eventarc.v1.stub.HttpJsonEventarcStub 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.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.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.common.collect.ImmutableMap;
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.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 Eventarc service API.
 *
 * 

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator-java") public class HttpJsonEventarcStub extends EventarcStub { private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder() .add(Channel.getDescriptor()) .add(OperationMetadata.getDescriptor()) .add(Trigger.getDescriptor()) .add(ChannelConnection.getDescriptor()) .build(); private static final ApiMethodDescriptor getTriggerMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetTrigger") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/triggers/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Trigger.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listTriggersMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListTriggers") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/triggers", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListTriggersResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createTriggerMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateTrigger") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/triggers", 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, "triggerId", request.getTriggerId()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("trigger", request.getTrigger(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (CreateTriggerRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor updateTriggerMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateTrigger") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{trigger.name=projects/*/locations/*/triggers/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "trigger.name", request.getTrigger().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam( fields, "allowMissing", request.getAllowMissing()); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("trigger", request.getTrigger(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (UpdateTriggerRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor deleteTriggerMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteTrigger") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/triggers/*}", 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, "validateOnly", request.getValidateOnly()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (DeleteTriggerRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor getChannelMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannel") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/channels/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Channel.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listChannelsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannels") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/channels", 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, "orderBy", request.getOrderBy()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListChannelsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createChannelMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannel") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/channels", 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, "channelId", request.getChannelId()); serializer.putQueryParam( fields, "validateOnly", request.getValidateOnly()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("channel", request.getChannel(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (CreateChannelRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor updateChannelMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateChannel") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{channel.name=projects/*/locations/*/channels/*}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "channel.name", request.getChannel().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()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("channel", request.getChannel(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (UpdateChannelRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor deleteChannelMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannel") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/channels/*}", 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, "validateOnly", request.getValidateOnly()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (DeleteChannelRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor getProviderMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetProvider") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/providers/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Provider.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listProvidersMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListProviders") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/providers", 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, "filter", request.getFilter()); serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); serializer.putQueryParam(fields, "pageToken", request.getPageToken()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListProvidersResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getChannelConnectionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannelConnection") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/channelConnections/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ChannelConnection.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor< ListChannelConnectionsRequest, ListChannelConnectionsResponse> listChannelConnectionsMethodDescriptor = ApiMethodDescriptor .newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannelConnections") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/channelConnections", 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()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListChannelConnectionsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor createChannelConnectionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannelConnection") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{parent=projects/*/locations/*}/channelConnections", 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, "channelConnectionId", request.getChannelConnectionId()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( "channelConnection", request.getChannelConnection(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (CreateChannelConnectionRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor deleteChannelConnectionMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection") .setHttpMethod("DELETE") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/channelConnections/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Operation.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .setOperationSnapshotFactory( (DeleteChannelConnectionRequest request, Operation response) -> HttpJsonOperationSnapshot.create(response)) .build(); private static final ApiMethodDescriptor getGoogleChannelConfigMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetGoogleChannelConfig") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*/googleChannelConfig}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(GoogleChannelConfig.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor updateGoogleChannelConfigMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateGoogleChannelConfig") .setHttpMethod("PATCH") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{googleChannelConfig.name=projects/*/locations/*/googleChannelConfig}", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam( fields, "googleChannelConfig.name", request.getGoogleChannelConfig().getName()); return fields; }) .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody( "googleChannelConfig", request.getGoogleChannelConfig(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(GoogleChannelConfig.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.location.Locations/ListLocations") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*}/locations", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getLocationMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.cloud.location.Locations/GetLocation") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{name=projects/*/locations/*}", 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, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Location.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor setIamPolicyMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{resource=projects/*/locations/*/triggers/*}:setIamPolicy", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "resource", request.getResource()); return fields; }) .setAdditionalPaths( "/v1/{resource=projects/*/locations/*/channels/*}:setIamPolicy", "/v1/{resource=projects/*/locations/*/channelConnections/*}:setIamPolicy") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Policy.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor getIamPolicyMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") .setHttpMethod("GET") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{resource=projects/*/locations/*/triggers/*}:getIamPolicy", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "resource", request.getResource()); return fields; }) .setAdditionalPaths( "/v1/{resource=projects/*/locations/*/channels/*}:getIamPolicy", "/v1/{resource=projects/*/locations/*/channelConnections/*}:getIamPolicy") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor(request -> null) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(Policy.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .build(); private static final ApiMethodDescriptor testIamPermissionsMethodDescriptor = ApiMethodDescriptor.newBuilder() .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") .setHttpMethod("POST") .setType(ApiMethodDescriptor.MethodType.UNARY) .setRequestFormatter( ProtoMessageRequestFormatter.newBuilder() .setPath( "/v1/{resource=projects/*/locations/*/triggers/*}:testIamPermissions", request -> { Map fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putPathParam(fields, "resource", request.getResource()); return fields; }) .setAdditionalPaths( "/v1/{resource=projects/*/locations/*/channels/*}:testIamPermissions", "/v1/{resource=projects/*/locations/*/channelConnections/*}:testIamPermissions") .setQueryParamsExtractor( request -> { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); return fields; }) .setRequestBodyExtractor( request -> ProtoRestSerializer.create() .toBody("*", request.toBuilder().clearResource().build(), true)) .build()) .setResponseParser( ProtoMessageResponseParser.newBuilder() .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) .setDefaultTypeRegistry(typeRegistry) .build()) .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 HttpJsonOperationsStub httpJsonOperationsStub; private final HttpJsonStubCallableFactory callableFactory; public static final HttpJsonEventarcStub create(EventarcStubSettings settings) throws IOException { return new HttpJsonEventarcStub(settings, ClientContext.create(settings)); } public static final HttpJsonEventarcStub create(ClientContext clientContext) throws IOException { return new HttpJsonEventarcStub( EventarcStubSettings.newHttpJsonBuilder().build(), clientContext); } public static final HttpJsonEventarcStub create( ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { return new HttpJsonEventarcStub( EventarcStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); } /** * Constructs an instance of HttpJsonEventarcStub, 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 HttpJsonEventarcStub(EventarcStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new HttpJsonEventarcCallableFactory()); } /** * Constructs an instance of HttpJsonEventarcStub, 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 HttpJsonEventarcStub( EventarcStubSettings 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 getTriggerTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getTriggerMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listTriggersTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listTriggersMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings createTriggerTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createTriggerMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateTriggerTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateTriggerMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("trigger.name", String.valueOf(request.getTrigger().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteTriggerTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteTriggerMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getChannelTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getChannelMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listChannelsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listChannelsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings createChannelTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createChannelMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings updateChannelTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateChannelMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("channel.name", String.valueOf(request.getChannel().getName())); return builder.build(); }) .build(); HttpJsonCallSettings deleteChannelTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteChannelMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getProviderTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getProviderMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listProvidersTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listProvidersMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings getChannelConnectionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getChannelConnectionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings listChannelConnectionsTransportSettings = HttpJsonCallSettings .newBuilder() .setMethodDescriptor(listChannelConnectionsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings createChannelConnectionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(createChannelConnectionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("parent", String.valueOf(request.getParent())); return builder.build(); }) .build(); HttpJsonCallSettings deleteChannelConnectionTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(deleteChannelConnectionMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getGoogleChannelConfigTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getGoogleChannelConfigMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings updateGoogleChannelConfigTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(updateGoogleChannelConfigMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add( "google_channel_config.name", String.valueOf(request.getGoogleChannelConfig().getName())); return builder.build(); }) .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings getLocationTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getLocationMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("name", String.valueOf(request.getName())); return builder.build(); }) .build(); HttpJsonCallSettings setIamPolicyTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); HttpJsonCallSettings getIamPolicyTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setTypeRegistry(typeRegistry) .setParamsExtractor( request -> { RequestParamsBuilder builder = RequestParamsBuilder.create(); builder.add("resource", String.valueOf(request.getResource())); return builder.build(); }) .build(); HttpJsonCallSettings testIamPermissionsTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setTypeRegistry(typeRegistry) .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, httpJsonOperationsStub); this.updateTriggerCallable = callableFactory.createUnaryCallable( updateTriggerTransportSettings, settings.updateTriggerSettings(), clientContext); this.updateTriggerOperationCallable = callableFactory.createOperationCallable( updateTriggerTransportSettings, settings.updateTriggerOperationSettings(), clientContext, httpJsonOperationsStub); this.deleteTriggerCallable = callableFactory.createUnaryCallable( deleteTriggerTransportSettings, settings.deleteTriggerSettings(), clientContext); this.deleteTriggerOperationCallable = callableFactory.createOperationCallable( deleteTriggerTransportSettings, settings.deleteTriggerOperationSettings(), clientContext, httpJsonOperationsStub); 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, httpJsonOperationsStub); this.updateChannelCallable = callableFactory.createUnaryCallable( updateChannelTransportSettings, settings.updateChannelSettings(), clientContext); this.updateChannelOperationCallable = callableFactory.createOperationCallable( updateChannelTransportSettings, settings.updateChannelOperationSettings(), clientContext, httpJsonOperationsStub); this.deleteChannelCallable = callableFactory.createUnaryCallable( deleteChannelTransportSettings, settings.deleteChannelSettings(), clientContext); this.deleteChannelOperationCallable = callableFactory.createOperationCallable( deleteChannelTransportSettings, settings.deleteChannelOperationSettings(), clientContext, httpJsonOperationsStub); 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, httpJsonOperationsStub); this.deleteChannelConnectionCallable = callableFactory.createUnaryCallable( deleteChannelConnectionTransportSettings, settings.deleteChannelConnectionSettings(), clientContext); this.deleteChannelConnectionOperationCallable = callableFactory.createOperationCallable( deleteChannelConnectionTransportSettings, settings.deleteChannelConnectionOperationSettings(), clientContext, httpJsonOperationsStub); 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()); } @InternalApi public static List getMethodDescriptors() { List methodDescriptors = new ArrayList<>(); methodDescriptors.add(getTriggerMethodDescriptor); methodDescriptors.add(listTriggersMethodDescriptor); methodDescriptors.add(createTriggerMethodDescriptor); methodDescriptors.add(updateTriggerMethodDescriptor); methodDescriptors.add(deleteTriggerMethodDescriptor); methodDescriptors.add(getChannelMethodDescriptor); methodDescriptors.add(listChannelsMethodDescriptor); methodDescriptors.add(createChannelMethodDescriptor); methodDescriptors.add(updateChannelMethodDescriptor); methodDescriptors.add(deleteChannelMethodDescriptor); methodDescriptors.add(getProviderMethodDescriptor); methodDescriptors.add(listProvidersMethodDescriptor); methodDescriptors.add(getChannelConnectionMethodDescriptor); methodDescriptors.add(listChannelConnectionsMethodDescriptor); methodDescriptors.add(createChannelConnectionMethodDescriptor); methodDescriptors.add(deleteChannelConnectionMethodDescriptor); methodDescriptors.add(getGoogleChannelConfigMethodDescriptor); methodDescriptors.add(updateGoogleChannelConfigMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); methodDescriptors.add(setIamPolicyMethodDescriptor); methodDescriptors.add(getIamPolicyMethodDescriptor); methodDescriptors.add(testIamPermissionsMethodDescriptor); return methodDescriptors; } public HttpJsonOperationsStub getHttpJsonOperationsStub() { return httpJsonOperationsStub; } @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