com.google.cloud.datastream.v1alpha1.stub.HttpJsonDatastreamStub Maven / Gradle / Ivy
Show all versions of google-cloud-datastream Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.datastream.v1alpha1.stub;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.FetchStaticIpsPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListConnectionProfilesPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListPrivateConnectionsPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListRoutesPagedResponse;
import static com.google.cloud.datastream.v1alpha1.DatastreamClient.ListStreamsPagedResponse;
import com.google.api.HttpRule;
import com.google.api.core.BetaApi;
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.datastream.v1alpha1.ConnectionProfile;
import com.google.cloud.datastream.v1alpha1.CreateConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.CreatePrivateConnectionRequest;
import com.google.cloud.datastream.v1alpha1.CreateRouteRequest;
import com.google.cloud.datastream.v1alpha1.CreateStreamRequest;
import com.google.cloud.datastream.v1alpha1.DeleteConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.DeletePrivateConnectionRequest;
import com.google.cloud.datastream.v1alpha1.DeleteRouteRequest;
import com.google.cloud.datastream.v1alpha1.DeleteStreamRequest;
import com.google.cloud.datastream.v1alpha1.DiscoverConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.DiscoverConnectionProfileResponse;
import com.google.cloud.datastream.v1alpha1.FetchErrorsRequest;
import com.google.cloud.datastream.v1alpha1.FetchErrorsResponse;
import com.google.cloud.datastream.v1alpha1.FetchStaticIpsRequest;
import com.google.cloud.datastream.v1alpha1.FetchStaticIpsResponse;
import com.google.cloud.datastream.v1alpha1.GetConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.GetPrivateConnectionRequest;
import com.google.cloud.datastream.v1alpha1.GetRouteRequest;
import com.google.cloud.datastream.v1alpha1.GetStreamRequest;
import com.google.cloud.datastream.v1alpha1.ListConnectionProfilesRequest;
import com.google.cloud.datastream.v1alpha1.ListConnectionProfilesResponse;
import com.google.cloud.datastream.v1alpha1.ListPrivateConnectionsRequest;
import com.google.cloud.datastream.v1alpha1.ListPrivateConnectionsResponse;
import com.google.cloud.datastream.v1alpha1.ListRoutesRequest;
import com.google.cloud.datastream.v1alpha1.ListRoutesResponse;
import com.google.cloud.datastream.v1alpha1.ListStreamsRequest;
import com.google.cloud.datastream.v1alpha1.ListStreamsResponse;
import com.google.cloud.datastream.v1alpha1.OperationMetadata;
import com.google.cloud.datastream.v1alpha1.PrivateConnection;
import com.google.cloud.datastream.v1alpha1.Route;
import com.google.cloud.datastream.v1alpha1.Stream;
import com.google.cloud.datastream.v1alpha1.UpdateConnectionProfileRequest;
import com.google.cloud.datastream.v1alpha1.UpdateStreamRequest;
import com.google.common.collect.ImmutableMap;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* REST stub implementation for the Datastream service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@BetaApi
@Generated("by gapic-generator-java")
public class HttpJsonDatastreamStub extends DatastreamStub {
private static final TypeRegistry typeRegistry =
TypeRegistry.newBuilder()
.add(Empty.getDescriptor())
.add(OperationMetadata.getDescriptor())
.add(Route.getDescriptor())
.add(FetchErrorsResponse.getDescriptor())
.add(ConnectionProfile.getDescriptor())
.add(Stream.getDescriptor())
.add(PrivateConnection.getDescriptor())
.build();
private static final ApiMethodDescriptor<
ListConnectionProfilesRequest, ListConnectionProfilesResponse>
listConnectionProfilesMethodDescriptor =
ApiMethodDescriptor
.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/ListConnectionProfiles")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/connectionProfiles",
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(ListConnectionProfilesResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
getConnectionProfileMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetConnectionProfile")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/connectionProfiles/*}",
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(ConnectionProfile.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
createConnectionProfileMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/CreateConnectionProfile")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/connectionProfiles",
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, "connectionProfileId", request.getConnectionProfileId());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
"connectionProfile", request.getConnectionProfile(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreateConnectionProfileRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
updateConnectionProfileMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/UpdateConnectionProfile")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{connectionProfile.name=projects/*/locations/*/connectionProfiles/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(
fields,
"connectionProfile.name",
request.getConnectionProfile().getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
"connectionProfile", request.getConnectionProfile(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(UpdateConnectionProfileRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
deleteConnectionProfileMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/DeleteConnectionProfile")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/connectionProfiles/*}",
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, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeleteConnectionProfileRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor<
DiscoverConnectionProfileRequest, DiscoverConnectionProfileResponse>
discoverConnectionProfileMethodDescriptor =
ApiMethodDescriptor
.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/DiscoverConnectionProfile")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/connectionProfiles:discover",
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, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(DiscoverConnectionProfileResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
listStreamsMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/ListStreams")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/streams",
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(ListStreamsResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor getStreamMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetStream")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/streams/*}",
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(Stream.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
createStreamMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/CreateStream")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/streams",
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, "force", request.getForce());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "streamId", request.getStreamId());
serializer.putQueryParam(
fields, "validateOnly", request.getValidateOnly());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("stream", request.getStream(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreateStreamRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
updateStreamMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/UpdateStream")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{stream.name=projects/*/locations/*/streams/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(
fields, "stream.name", request.getStream().getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "force", request.getForce());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
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("stream", request.getStream(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(UpdateStreamRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
deleteStreamMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/DeleteStream")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/streams/*}",
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, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeleteStreamRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
fetchErrorsMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/FetchErrors")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{stream=projects/*/locations/*/streams/*}:fetchErrors",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "stream", request.getStream());
return fields;
})
.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().clearStream().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(FetchErrorsRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
fetchStaticIpsMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/FetchStaticIps")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*}:fetchStaticIps",
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, "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(FetchStaticIpsResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
createPrivateConnectionMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/CreatePrivateConnection")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/privateConnections",
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, "privateConnectionId", request.getPrivateConnectionId());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody(
"privateConnection", request.getPrivateConnection(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreatePrivateConnectionRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
getPrivateConnectionMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetPrivateConnection")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/privateConnections/*}",
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(PrivateConnection.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor<
ListPrivateConnectionsRequest, ListPrivateConnectionsResponse>
listPrivateConnectionsMethodDescriptor =
ApiMethodDescriptor
.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/ListPrivateConnections")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*}/privateConnections",
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(ListPrivateConnectionsResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
deletePrivateConnectionMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName(
"google.cloud.datastream.v1alpha1.Datastream/DeletePrivateConnection")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/privateConnections/*}",
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, "force", request.getForce());
serializer.putQueryParam(fields, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeletePrivateConnectionRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor
createRouteMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/CreateRoute")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*/privateConnections/*}/routes",
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, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "routeId", request.getRouteId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("route", request.getRoute(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(CreateRouteRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private static final ApiMethodDescriptor getRouteMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/GetRoute")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/privateConnections/*/routes/*}",
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(Route.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
listRoutesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/ListRoutes")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{parent=projects/*/locations/*/privateConnections/*}/routes",
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(ListRoutesResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
deleteRouteMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.datastream.v1alpha1.Datastream/DeleteRoute")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*/privateConnections/*/routes/*}",
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, "requestId", request.getRequestId());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Operation.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.setOperationSnapshotFactory(
(DeleteRouteRequest request, Operation response) ->
HttpJsonOperationSnapshot.create(response))
.build();
private final UnaryCallable
listConnectionProfilesCallable;
private final UnaryCallable
listConnectionProfilesPagedCallable;
private final UnaryCallable
getConnectionProfileCallable;
private final UnaryCallable
createConnectionProfileCallable;
private final OperationCallable<
CreateConnectionProfileRequest, ConnectionProfile, OperationMetadata>
createConnectionProfileOperationCallable;
private final UnaryCallable
updateConnectionProfileCallable;
private final OperationCallable<
UpdateConnectionProfileRequest, ConnectionProfile, OperationMetadata>
updateConnectionProfileOperationCallable;
private final UnaryCallable
deleteConnectionProfileCallable;
private final OperationCallable
deleteConnectionProfileOperationCallable;
private final UnaryCallable
discoverConnectionProfileCallable;
private final UnaryCallable listStreamsCallable;
private final UnaryCallable
listStreamsPagedCallable;
private final UnaryCallable getStreamCallable;
private final UnaryCallable createStreamCallable;
private final OperationCallable
createStreamOperationCallable;
private final UnaryCallable updateStreamCallable;
private final OperationCallable
updateStreamOperationCallable;
private final UnaryCallable deleteStreamCallable;
private final OperationCallable
deleteStreamOperationCallable;
private final UnaryCallable fetchErrorsCallable;
private final OperationCallable
fetchErrorsOperationCallable;
private final UnaryCallable fetchStaticIpsCallable;
private final UnaryCallable
fetchStaticIpsPagedCallable;
private final UnaryCallable
createPrivateConnectionCallable;
private final OperationCallable<
CreatePrivateConnectionRequest, PrivateConnection, OperationMetadata>
createPrivateConnectionOperationCallable;
private final UnaryCallable
getPrivateConnectionCallable;
private final UnaryCallable
listPrivateConnectionsCallable;
private final UnaryCallable
listPrivateConnectionsPagedCallable;
private final UnaryCallable
deletePrivateConnectionCallable;
private final OperationCallable
deletePrivateConnectionOperationCallable;
private final UnaryCallable createRouteCallable;
private final OperationCallable
createRouteOperationCallable;
private final UnaryCallable getRouteCallable;
private final UnaryCallable listRoutesCallable;
private final UnaryCallable listRoutesPagedCallable;
private final UnaryCallable deleteRouteCallable;
private final OperationCallable
deleteRouteOperationCallable;
private final BackgroundResource backgroundResources;
private final HttpJsonOperationsStub httpJsonOperationsStub;
private final HttpJsonStubCallableFactory callableFactory;
public static final HttpJsonDatastreamStub create(DatastreamStubSettings settings)
throws IOException {
return new HttpJsonDatastreamStub(settings, ClientContext.create(settings));
}
public static final HttpJsonDatastreamStub create(ClientContext clientContext)
throws IOException {
return new HttpJsonDatastreamStub(
DatastreamStubSettings.newHttpJsonBuilder().build(), clientContext);
}
public static final HttpJsonDatastreamStub create(
ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
return new HttpJsonDatastreamStub(
DatastreamStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of HttpJsonDatastreamStub, 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 HttpJsonDatastreamStub(DatastreamStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new HttpJsonDatastreamCallableFactory());
}
/**
* Constructs an instance of HttpJsonDatastreamStub, 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 HttpJsonDatastreamStub(
DatastreamStubSettings 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("/v1alpha1/{name=projects/*/locations/*/operations/*}:cancel")
.build())
.put(
"google.longrunning.Operations.DeleteOperation",
HttpRule.newBuilder()
.setDelete("/v1alpha1/{name=projects/*/locations/*/operations/*}")
.build())
.put(
"google.longrunning.Operations.GetOperation",
HttpRule.newBuilder()
.setGet("/v1alpha1/{name=projects/*/locations/*/operations/*}")
.build())
.put(
"google.longrunning.Operations.ListOperations",
HttpRule.newBuilder()
.setGet("/v1alpha1/{name=projects/*/locations/*}/operations")
.build())
.build());
HttpJsonCallSettings
listConnectionProfilesTransportSettings =
HttpJsonCallSettings
.newBuilder()
.setMethodDescriptor(listConnectionProfilesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
getConnectionProfileTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getConnectionProfileMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
createConnectionProfileTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createConnectionProfileMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
updateConnectionProfileTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updateConnectionProfileMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"connection_profile.name",
String.valueOf(request.getConnectionProfile().getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
deleteConnectionProfileTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteConnectionProfileMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
discoverConnectionProfileTransportSettings =
HttpJsonCallSettings
.newBuilder()
.setMethodDescriptor(discoverConnectionProfileMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings listStreamsTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(listStreamsMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings getStreamTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getStreamMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings createStreamTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createStreamMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings updateStreamTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updateStreamMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("stream.name", String.valueOf(request.getStream().getName()));
return builder.build();
})
.build();
HttpJsonCallSettings deleteStreamTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteStreamMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings fetchErrorsTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(fetchErrorsMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("stream", String.valueOf(request.getStream()));
return builder.build();
})
.build();
HttpJsonCallSettings
fetchStaticIpsTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(fetchStaticIpsMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
createPrivateConnectionTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createPrivateConnectionMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
getPrivateConnectionTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getPrivateConnectionMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
listPrivateConnectionsTransportSettings =
HttpJsonCallSettings
.newBuilder()
.setMethodDescriptor(listPrivateConnectionsMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings
deletePrivateConnectionTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deletePrivateConnectionMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings createRouteTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createRouteMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings getRouteTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getRouteMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings listRoutesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(listRoutesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings deleteRouteTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteRouteMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
this.listConnectionProfilesCallable =
callableFactory.createUnaryCallable(
listConnectionProfilesTransportSettings,
settings.listConnectionProfilesSettings(),
clientContext);
this.listConnectionProfilesPagedCallable =
callableFactory.createPagedCallable(
listConnectionProfilesTransportSettings,
settings.listConnectionProfilesSettings(),
clientContext);
this.getConnectionProfileCallable =
callableFactory.createUnaryCallable(
getConnectionProfileTransportSettings,
settings.getConnectionProfileSettings(),
clientContext);
this.createConnectionProfileCallable =
callableFactory.createUnaryCallable(
createConnectionProfileTransportSettings,
settings.createConnectionProfileSettings(),
clientContext);
this.createConnectionProfileOperationCallable =
callableFactory.createOperationCallable(
createConnectionProfileTransportSettings,
settings.createConnectionProfileOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.updateConnectionProfileCallable =
callableFactory.createUnaryCallable(
updateConnectionProfileTransportSettings,
settings.updateConnectionProfileSettings(),
clientContext);
this.updateConnectionProfileOperationCallable =
callableFactory.createOperationCallable(
updateConnectionProfileTransportSettings,
settings.updateConnectionProfileOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.deleteConnectionProfileCallable =
callableFactory.createUnaryCallable(
deleteConnectionProfileTransportSettings,
settings.deleteConnectionProfileSettings(),
clientContext);
this.deleteConnectionProfileOperationCallable =
callableFactory.createOperationCallable(
deleteConnectionProfileTransportSettings,
settings.deleteConnectionProfileOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.discoverConnectionProfileCallable =
callableFactory.createUnaryCallable(
discoverConnectionProfileTransportSettings,
settings.discoverConnectionProfileSettings(),
clientContext);
this.listStreamsCallable =
callableFactory.createUnaryCallable(
listStreamsTransportSettings, settings.listStreamsSettings(), clientContext);
this.listStreamsPagedCallable =
callableFactory.createPagedCallable(
listStreamsTransportSettings, settings.listStreamsSettings(), clientContext);
this.getStreamCallable =
callableFactory.createUnaryCallable(
getStreamTransportSettings, settings.getStreamSettings(), clientContext);
this.createStreamCallable =
callableFactory.createUnaryCallable(
createStreamTransportSettings, settings.createStreamSettings(), clientContext);
this.createStreamOperationCallable =
callableFactory.createOperationCallable(
createStreamTransportSettings,
settings.createStreamOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.updateStreamCallable =
callableFactory.createUnaryCallable(
updateStreamTransportSettings, settings.updateStreamSettings(), clientContext);
this.updateStreamOperationCallable =
callableFactory.createOperationCallable(
updateStreamTransportSettings,
settings.updateStreamOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.deleteStreamCallable =
callableFactory.createUnaryCallable(
deleteStreamTransportSettings, settings.deleteStreamSettings(), clientContext);
this.deleteStreamOperationCallable =
callableFactory.createOperationCallable(
deleteStreamTransportSettings,
settings.deleteStreamOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.fetchErrorsCallable =
callableFactory.createUnaryCallable(
fetchErrorsTransportSettings, settings.fetchErrorsSettings(), clientContext);
this.fetchErrorsOperationCallable =
callableFactory.createOperationCallable(
fetchErrorsTransportSettings,
settings.fetchErrorsOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.fetchStaticIpsCallable =
callableFactory.createUnaryCallable(
fetchStaticIpsTransportSettings, settings.fetchStaticIpsSettings(), clientContext);
this.fetchStaticIpsPagedCallable =
callableFactory.createPagedCallable(
fetchStaticIpsTransportSettings, settings.fetchStaticIpsSettings(), clientContext);
this.createPrivateConnectionCallable =
callableFactory.createUnaryCallable(
createPrivateConnectionTransportSettings,
settings.createPrivateConnectionSettings(),
clientContext);
this.createPrivateConnectionOperationCallable =
callableFactory.createOperationCallable(
createPrivateConnectionTransportSettings,
settings.createPrivateConnectionOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.getPrivateConnectionCallable =
callableFactory.createUnaryCallable(
getPrivateConnectionTransportSettings,
settings.getPrivateConnectionSettings(),
clientContext);
this.listPrivateConnectionsCallable =
callableFactory.createUnaryCallable(
listPrivateConnectionsTransportSettings,
settings.listPrivateConnectionsSettings(),
clientContext);
this.listPrivateConnectionsPagedCallable =
callableFactory.createPagedCallable(
listPrivateConnectionsTransportSettings,
settings.listPrivateConnectionsSettings(),
clientContext);
this.deletePrivateConnectionCallable =
callableFactory.createUnaryCallable(
deletePrivateConnectionTransportSettings,
settings.deletePrivateConnectionSettings(),
clientContext);
this.deletePrivateConnectionOperationCallable =
callableFactory.createOperationCallable(
deletePrivateConnectionTransportSettings,
settings.deletePrivateConnectionOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.createRouteCallable =
callableFactory.createUnaryCallable(
createRouteTransportSettings, settings.createRouteSettings(), clientContext);
this.createRouteOperationCallable =
callableFactory.createOperationCallable(
createRouteTransportSettings,
settings.createRouteOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.getRouteCallable =
callableFactory.createUnaryCallable(
getRouteTransportSettings, settings.getRouteSettings(), clientContext);
this.listRoutesCallable =
callableFactory.createUnaryCallable(
listRoutesTransportSettings, settings.listRoutesSettings(), clientContext);
this.listRoutesPagedCallable =
callableFactory.createPagedCallable(
listRoutesTransportSettings, settings.listRoutesSettings(), clientContext);
this.deleteRouteCallable =
callableFactory.createUnaryCallable(
deleteRouteTransportSettings, settings.deleteRouteSettings(), clientContext);
this.deleteRouteOperationCallable =
callableFactory.createOperationCallable(
deleteRouteTransportSettings,
settings.deleteRouteOperationSettings(),
clientContext,
httpJsonOperationsStub);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
@InternalApi
public static List getMethodDescriptors() {
List methodDescriptors = new ArrayList<>();
methodDescriptors.add(listConnectionProfilesMethodDescriptor);
methodDescriptors.add(getConnectionProfileMethodDescriptor);
methodDescriptors.add(createConnectionProfileMethodDescriptor);
methodDescriptors.add(updateConnectionProfileMethodDescriptor);
methodDescriptors.add(deleteConnectionProfileMethodDescriptor);
methodDescriptors.add(discoverConnectionProfileMethodDescriptor);
methodDescriptors.add(listStreamsMethodDescriptor);
methodDescriptors.add(getStreamMethodDescriptor);
methodDescriptors.add(createStreamMethodDescriptor);
methodDescriptors.add(updateStreamMethodDescriptor);
methodDescriptors.add(deleteStreamMethodDescriptor);
methodDescriptors.add(fetchErrorsMethodDescriptor);
methodDescriptors.add(fetchStaticIpsMethodDescriptor);
methodDescriptors.add(createPrivateConnectionMethodDescriptor);
methodDescriptors.add(getPrivateConnectionMethodDescriptor);
methodDescriptors.add(listPrivateConnectionsMethodDescriptor);
methodDescriptors.add(deletePrivateConnectionMethodDescriptor);
methodDescriptors.add(createRouteMethodDescriptor);
methodDescriptors.add(getRouteMethodDescriptor);
methodDescriptors.add(listRoutesMethodDescriptor);
methodDescriptors.add(deleteRouteMethodDescriptor);
return methodDescriptors;
}
public HttpJsonOperationsStub getHttpJsonOperationsStub() {
return httpJsonOperationsStub;
}
@Override
public UnaryCallable
listConnectionProfilesCallable() {
return listConnectionProfilesCallable;
}
@Override
public UnaryCallable
listConnectionProfilesPagedCallable() {
return listConnectionProfilesPagedCallable;
}
@Override
public UnaryCallable
getConnectionProfileCallable() {
return getConnectionProfileCallable;
}
@Override
public UnaryCallable
createConnectionProfileCallable() {
return createConnectionProfileCallable;
}
@Override
public OperationCallable
createConnectionProfileOperationCallable() {
return createConnectionProfileOperationCallable;
}
@Override
public UnaryCallable