com.google.cloud.visionai.v1.stub.GrpcStreamsServiceStub Maven / Gradle / Ivy
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.visionai.v1.stub;
import static com.google.cloud.visionai.v1.StreamsServiceClient.ListClustersPagedResponse;
import static com.google.cloud.visionai.v1.StreamsServiceClient.ListEventsPagedResponse;
import static com.google.cloud.visionai.v1.StreamsServiceClient.ListSeriesPagedResponse;
import static com.google.cloud.visionai.v1.StreamsServiceClient.ListStreamsPagedResponse;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.visionai.v1.Channel;
import com.google.cloud.visionai.v1.Cluster;
import com.google.cloud.visionai.v1.CreateClusterRequest;
import com.google.cloud.visionai.v1.CreateEventRequest;
import com.google.cloud.visionai.v1.CreateSeriesRequest;
import com.google.cloud.visionai.v1.CreateStreamRequest;
import com.google.cloud.visionai.v1.DeleteClusterRequest;
import com.google.cloud.visionai.v1.DeleteEventRequest;
import com.google.cloud.visionai.v1.DeleteSeriesRequest;
import com.google.cloud.visionai.v1.DeleteStreamRequest;
import com.google.cloud.visionai.v1.Event;
import com.google.cloud.visionai.v1.GenerateStreamHlsTokenRequest;
import com.google.cloud.visionai.v1.GenerateStreamHlsTokenResponse;
import com.google.cloud.visionai.v1.GetClusterRequest;
import com.google.cloud.visionai.v1.GetEventRequest;
import com.google.cloud.visionai.v1.GetSeriesRequest;
import com.google.cloud.visionai.v1.GetStreamRequest;
import com.google.cloud.visionai.v1.GetStreamThumbnailRequest;
import com.google.cloud.visionai.v1.GetStreamThumbnailResponse;
import com.google.cloud.visionai.v1.ListClustersRequest;
import com.google.cloud.visionai.v1.ListClustersResponse;
import com.google.cloud.visionai.v1.ListEventsRequest;
import com.google.cloud.visionai.v1.ListEventsResponse;
import com.google.cloud.visionai.v1.ListSeriesRequest;
import com.google.cloud.visionai.v1.ListSeriesResponse;
import com.google.cloud.visionai.v1.ListStreamsRequest;
import com.google.cloud.visionai.v1.ListStreamsResponse;
import com.google.cloud.visionai.v1.MaterializeChannelRequest;
import com.google.cloud.visionai.v1.OperationMetadata;
import com.google.cloud.visionai.v1.Series;
import com.google.cloud.visionai.v1.Stream;
import com.google.cloud.visionai.v1.UpdateClusterRequest;
import com.google.cloud.visionai.v1.UpdateEventRequest;
import com.google.cloud.visionai.v1.UpdateSeriesRequest;
import com.google.cloud.visionai.v1.UpdateStreamRequest;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.protobuf.Empty;
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* gRPC stub implementation for the StreamsService service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public class GrpcStreamsServiceStub extends StreamsServiceStub {
private static final MethodDescriptor
listClustersMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/ListClusters")
.setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/GetCluster")
.setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance()))
.build();
private static final MethodDescriptor
createClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/CreateCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/UpdateCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteClusterMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/DeleteCluster")
.setRequestMarshaller(
ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
listStreamsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/ListStreams")
.setRequestMarshaller(ProtoUtils.marshaller(ListStreamsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(ListStreamsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getStreamMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/GetStream")
.setRequestMarshaller(ProtoUtils.marshaller(GetStreamRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Stream.getDefaultInstance()))
.build();
private static final MethodDescriptor
createStreamMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/CreateStream")
.setRequestMarshaller(ProtoUtils.marshaller(CreateStreamRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateStreamMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/UpdateStream")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateStreamRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteStreamMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/DeleteStream")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteStreamRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
getStreamThumbnailMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/GetStreamThumbnail")
.setRequestMarshaller(
ProtoUtils.marshaller(GetStreamThumbnailRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor<
GenerateStreamHlsTokenRequest, GenerateStreamHlsTokenResponse>
generateStreamHlsTokenMethodDescriptor =
MethodDescriptor
.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/GenerateStreamHlsToken")
.setRequestMarshaller(
ProtoUtils.marshaller(GenerateStreamHlsTokenRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(GenerateStreamHlsTokenResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor
listEventsMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/ListEvents")
.setRequestMarshaller(ProtoUtils.marshaller(ListEventsRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListEventsResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getEventMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/GetEvent")
.setRequestMarshaller(ProtoUtils.marshaller(GetEventRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Event.getDefaultInstance()))
.build();
private static final MethodDescriptor createEventMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/CreateEvent")
.setRequestMarshaller(ProtoUtils.marshaller(CreateEventRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor updateEventMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/UpdateEvent")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateEventRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor deleteEventMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/DeleteEvent")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteEventRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
listSeriesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/ListSeries")
.setRequestMarshaller(ProtoUtils.marshaller(ListSeriesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(ListSeriesResponse.getDefaultInstance()))
.build();
private static final MethodDescriptor getSeriesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/GetSeries")
.setRequestMarshaller(ProtoUtils.marshaller(GetSeriesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Series.getDefaultInstance()))
.build();
private static final MethodDescriptor
createSeriesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/CreateSeries")
.setRequestMarshaller(ProtoUtils.marshaller(CreateSeriesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
updateSeriesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/UpdateSeries")
.setRequestMarshaller(ProtoUtils.marshaller(UpdateSeriesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
deleteSeriesMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/DeleteSeries")
.setRequestMarshaller(ProtoUtils.marshaller(DeleteSeriesRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private static final MethodDescriptor
materializeChannelMethodDescriptor =
MethodDescriptor.newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.visionai.v1.StreamsService/MaterializeChannel")
.setRequestMarshaller(
ProtoUtils.marshaller(MaterializeChannelRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();
private final UnaryCallable listClustersCallable;
private final UnaryCallable
listClustersPagedCallable;
private final UnaryCallable getClusterCallable;
private final UnaryCallable createClusterCallable;
private final OperationCallable
createClusterOperationCallable;
private final UnaryCallable updateClusterCallable;
private final OperationCallable
updateClusterOperationCallable;
private final UnaryCallable deleteClusterCallable;
private final OperationCallable
deleteClusterOperationCallable;
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 getStreamThumbnailCallable;
private final OperationCallable<
GetStreamThumbnailRequest, GetStreamThumbnailResponse, OperationMetadata>
getStreamThumbnailOperationCallable;
private final UnaryCallable
generateStreamHlsTokenCallable;
private final UnaryCallable listEventsCallable;
private final UnaryCallable listEventsPagedCallable;
private final UnaryCallable getEventCallable;
private final UnaryCallable createEventCallable;
private final OperationCallable
createEventOperationCallable;
private final UnaryCallable updateEventCallable;
private final OperationCallable
updateEventOperationCallable;
private final UnaryCallable deleteEventCallable;
private final OperationCallable
deleteEventOperationCallable;
private final UnaryCallable listSeriesCallable;
private final UnaryCallable listSeriesPagedCallable;
private final UnaryCallable getSeriesCallable;
private final UnaryCallable createSeriesCallable;
private final OperationCallable
createSeriesOperationCallable;
private final UnaryCallable updateSeriesCallable;
private final OperationCallable
updateSeriesOperationCallable;
private final UnaryCallable deleteSeriesCallable;
private final OperationCallable
deleteSeriesOperationCallable;
private final UnaryCallable materializeChannelCallable;
private final OperationCallable
materializeChannelOperationCallable;
private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
private final GrpcStubCallableFactory callableFactory;
public static final GrpcStreamsServiceStub create(StreamsServiceStubSettings settings)
throws IOException {
return new GrpcStreamsServiceStub(settings, ClientContext.create(settings));
}
public static final GrpcStreamsServiceStub create(ClientContext clientContext)
throws IOException {
return new GrpcStreamsServiceStub(
StreamsServiceStubSettings.newBuilder().build(), clientContext);
}
public static final GrpcStreamsServiceStub create(
ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
return new GrpcStreamsServiceStub(
StreamsServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of GrpcStreamsServiceStub, 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 GrpcStreamsServiceStub(StreamsServiceStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new GrpcStreamsServiceCallableFactory());
}
/**
* Constructs an instance of GrpcStreamsServiceStub, 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 GrpcStreamsServiceStub(
StreamsServiceStubSettings settings,
ClientContext clientContext,
GrpcStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
GrpcCallSettings listClustersTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listClustersMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("cluster.name", String.valueOf(request.getCluster().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteClusterTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteClusterMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings listStreamsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listStreamsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getStreamTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getStreamMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createStreamTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createStreamMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateStreamTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateStreamMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("stream.name", String.valueOf(request.getStream().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteStreamTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteStreamMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings getStreamThumbnailTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getStreamThumbnailMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("stream", String.valueOf(request.getStream()));
return builder.build();
})
.build();
GrpcCallSettings
generateStreamHlsTokenTransportSettings =
GrpcCallSettings
.newBuilder()
.setMethodDescriptor(generateStreamHlsTokenMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("stream", String.valueOf(request.getStream()));
return builder.build();
})
.build();
GrpcCallSettings listEventsTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listEventsMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getEventTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getEventMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createEventTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createEventMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateEventTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateEventMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("event.name", String.valueOf(request.getEvent().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteEventTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteEventMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings listSeriesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(listSeriesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings getSeriesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(getSeriesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings createSeriesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(createSeriesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
GrpcCallSettings updateSeriesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(updateSeriesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("series.name", String.valueOf(request.getSeries().getName()));
return builder.build();
})
.build();
GrpcCallSettings deleteSeriesTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(deleteSeriesMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings materializeChannelTransportSettings =
GrpcCallSettings.newBuilder()
.setMethodDescriptor(materializeChannelMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
this.listClustersCallable =
callableFactory.createUnaryCallable(
listClustersTransportSettings, settings.listClustersSettings(), clientContext);
this.listClustersPagedCallable =
callableFactory.createPagedCallable(
listClustersTransportSettings, settings.listClustersSettings(), clientContext);
this.getClusterCallable =
callableFactory.createUnaryCallable(
getClusterTransportSettings, settings.getClusterSettings(), clientContext);
this.createClusterCallable =
callableFactory.createUnaryCallable(
createClusterTransportSettings, settings.createClusterSettings(), clientContext);
this.createClusterOperationCallable =
callableFactory.createOperationCallable(
createClusterTransportSettings,
settings.createClusterOperationSettings(),
clientContext,
operationsStub);
this.updateClusterCallable =
callableFactory.createUnaryCallable(
updateClusterTransportSettings, settings.updateClusterSettings(), clientContext);
this.updateClusterOperationCallable =
callableFactory.createOperationCallable(
updateClusterTransportSettings,
settings.updateClusterOperationSettings(),
clientContext,
operationsStub);
this.deleteClusterCallable =
callableFactory.createUnaryCallable(
deleteClusterTransportSettings, settings.deleteClusterSettings(), clientContext);
this.deleteClusterOperationCallable =
callableFactory.createOperationCallable(
deleteClusterTransportSettings,
settings.deleteClusterOperationSettings(),
clientContext,
operationsStub);
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,
operationsStub);
this.updateStreamCallable =
callableFactory.createUnaryCallable(
updateStreamTransportSettings, settings.updateStreamSettings(), clientContext);
this.updateStreamOperationCallable =
callableFactory.createOperationCallable(
updateStreamTransportSettings,
settings.updateStreamOperationSettings(),
clientContext,
operationsStub);
this.deleteStreamCallable =
callableFactory.createUnaryCallable(
deleteStreamTransportSettings, settings.deleteStreamSettings(), clientContext);
this.deleteStreamOperationCallable =
callableFactory.createOperationCallable(
deleteStreamTransportSettings,
settings.deleteStreamOperationSettings(),
clientContext,
operationsStub);
this.getStreamThumbnailCallable =
callableFactory.createUnaryCallable(
getStreamThumbnailTransportSettings,
settings.getStreamThumbnailSettings(),
clientContext);
this.getStreamThumbnailOperationCallable =
callableFactory.createOperationCallable(
getStreamThumbnailTransportSettings,
settings.getStreamThumbnailOperationSettings(),
clientContext,
operationsStub);
this.generateStreamHlsTokenCallable =
callableFactory.createUnaryCallable(
generateStreamHlsTokenTransportSettings,
settings.generateStreamHlsTokenSettings(),
clientContext);
this.listEventsCallable =
callableFactory.createUnaryCallable(
listEventsTransportSettings, settings.listEventsSettings(), clientContext);
this.listEventsPagedCallable =
callableFactory.createPagedCallable(
listEventsTransportSettings, settings.listEventsSettings(), clientContext);
this.getEventCallable =
callableFactory.createUnaryCallable(
getEventTransportSettings, settings.getEventSettings(), clientContext);
this.createEventCallable =
callableFactory.createUnaryCallable(
createEventTransportSettings, settings.createEventSettings(), clientContext);
this.createEventOperationCallable =
callableFactory.createOperationCallable(
createEventTransportSettings,
settings.createEventOperationSettings(),
clientContext,
operationsStub);
this.updateEventCallable =
callableFactory.createUnaryCallable(
updateEventTransportSettings, settings.updateEventSettings(), clientContext);
this.updateEventOperationCallable =
callableFactory.createOperationCallable(
updateEventTransportSettings,
settings.updateEventOperationSettings(),
clientContext,
operationsStub);
this.deleteEventCallable =
callableFactory.createUnaryCallable(
deleteEventTransportSettings, settings.deleteEventSettings(), clientContext);
this.deleteEventOperationCallable =
callableFactory.createOperationCallable(
deleteEventTransportSettings,
settings.deleteEventOperationSettings(),
clientContext,
operationsStub);
this.listSeriesCallable =
callableFactory.createUnaryCallable(
listSeriesTransportSettings, settings.listSeriesSettings(), clientContext);
this.listSeriesPagedCallable =
callableFactory.createPagedCallable(
listSeriesTransportSettings, settings.listSeriesSettings(), clientContext);
this.getSeriesCallable =
callableFactory.createUnaryCallable(
getSeriesTransportSettings, settings.getSeriesSettings(), clientContext);
this.createSeriesCallable =
callableFactory.createUnaryCallable(
createSeriesTransportSettings, settings.createSeriesSettings(), clientContext);
this.createSeriesOperationCallable =
callableFactory.createOperationCallable(
createSeriesTransportSettings,
settings.createSeriesOperationSettings(),
clientContext,
operationsStub);
this.updateSeriesCallable =
callableFactory.createUnaryCallable(
updateSeriesTransportSettings, settings.updateSeriesSettings(), clientContext);
this.updateSeriesOperationCallable =
callableFactory.createOperationCallable(
updateSeriesTransportSettings,
settings.updateSeriesOperationSettings(),
clientContext,
operationsStub);
this.deleteSeriesCallable =
callableFactory.createUnaryCallable(
deleteSeriesTransportSettings, settings.deleteSeriesSettings(), clientContext);
this.deleteSeriesOperationCallable =
callableFactory.createOperationCallable(
deleteSeriesTransportSettings,
settings.deleteSeriesOperationSettings(),
clientContext,
operationsStub);
this.materializeChannelCallable =
callableFactory.createUnaryCallable(
materializeChannelTransportSettings,
settings.materializeChannelSettings(),
clientContext);
this.materializeChannelOperationCallable =
callableFactory.createOperationCallable(
materializeChannelTransportSettings,
settings.materializeChannelOperationSettings(),
clientContext,
operationsStub);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
public GrpcOperationsStub getOperationsStub() {
return operationsStub;
}
@Override
public UnaryCallable listClustersCallable() {
return listClustersCallable;
}
@Override
public UnaryCallable listClustersPagedCallable() {
return listClustersPagedCallable;
}
@Override
public UnaryCallable getClusterCallable() {
return getClusterCallable;
}
@Override
public UnaryCallable createClusterCallable() {
return createClusterCallable;
}
@Override
public OperationCallable
createClusterOperationCallable() {
return createClusterOperationCallable;
}
@Override
public UnaryCallable updateClusterCallable() {
return updateClusterCallable;
}
@Override
public OperationCallable
updateClusterOperationCallable() {
return updateClusterOperationCallable;
}
@Override
public UnaryCallable deleteClusterCallable() {
return deleteClusterCallable;
}
@Override
public OperationCallable
deleteClusterOperationCallable() {
return deleteClusterOperationCallable;
}
@Override
public UnaryCallable listStreamsCallable() {
return listStreamsCallable;
}
@Override
public UnaryCallable listStreamsPagedCallable() {
return listStreamsPagedCallable;
}
@Override
public UnaryCallable getStreamCallable() {
return getStreamCallable;
}
@Override
public UnaryCallable createStreamCallable() {
return createStreamCallable;
}
@Override
public OperationCallable
createStreamOperationCallable() {
return createStreamOperationCallable;
}
@Override
public UnaryCallable updateStreamCallable() {
return updateStreamCallable;
}
@Override
public OperationCallable
updateStreamOperationCallable() {
return updateStreamOperationCallable;
}
@Override
public UnaryCallable deleteStreamCallable() {
return deleteStreamCallable;
}
@Override
public OperationCallable
deleteStreamOperationCallable() {
return deleteStreamOperationCallable;
}
@Override
public UnaryCallable getStreamThumbnailCallable() {
return getStreamThumbnailCallable;
}
@Override
public OperationCallable
getStreamThumbnailOperationCallable() {
return getStreamThumbnailOperationCallable;
}
@Override
public UnaryCallable
generateStreamHlsTokenCallable() {
return generateStreamHlsTokenCallable;
}
@Override
public UnaryCallable listEventsCallable() {
return listEventsCallable;
}
@Override
public UnaryCallable listEventsPagedCallable() {
return listEventsPagedCallable;
}
@Override
public UnaryCallable getEventCallable() {
return getEventCallable;
}
@Override
public UnaryCallable createEventCallable() {
return createEventCallable;
}
@Override
public OperationCallable
createEventOperationCallable() {
return createEventOperationCallable;
}
@Override
public UnaryCallable updateEventCallable() {
return updateEventCallable;
}
@Override
public OperationCallable
updateEventOperationCallable() {
return updateEventOperationCallable;
}
@Override
public UnaryCallable deleteEventCallable() {
return deleteEventCallable;
}
@Override
public OperationCallable
deleteEventOperationCallable() {
return deleteEventOperationCallable;
}
@Override
public UnaryCallable listSeriesCallable() {
return listSeriesCallable;
}
@Override
public UnaryCallable listSeriesPagedCallable() {
return listSeriesPagedCallable;
}
@Override
public UnaryCallable getSeriesCallable() {
return getSeriesCallable;
}
@Override
public UnaryCallable createSeriesCallable() {
return createSeriesCallable;
}
@Override
public OperationCallable
createSeriesOperationCallable() {
return createSeriesOperationCallable;
}
@Override
public UnaryCallable updateSeriesCallable() {
return updateSeriesCallable;
}
@Override
public OperationCallable
updateSeriesOperationCallable() {
return updateSeriesOperationCallable;
}
@Override
public UnaryCallable deleteSeriesCallable() {
return deleteSeriesCallable;
}
@Override
public OperationCallable
deleteSeriesOperationCallable() {
return deleteSeriesOperationCallable;
}
@Override
public UnaryCallable materializeChannelCallable() {
return materializeChannelCallable;
}
@Override
public OperationCallable
materializeChannelOperationCallable() {
return materializeChannelOperationCallable;
}
@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);
}
}