com.google.cloud.visionai.v1.StreamsServiceClient 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;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.visionai.v1.stub.StreamsServiceStub;
import com.google.cloud.visionai.v1.stub.StreamsServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Service Description: Service describing handlers for resources. Vision API and Vision AI API are
* two independent APIs developed by the same team. Vision API is for people to annotate their image
* while Vision AI is an e2e solution for customer to build their own computer vision application.
*
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* Cluster response = streamsServiceClient.getCluster(name);
* }
* }
*
* Note: close() needs to be called on the StreamsServiceClient object to clean up resources such
* as threads. In the example above, try-with-resources is used, which automatically calls close().
*
*
* Methods
*
* Method
* Description
* Method Variants
*
*
* ListClusters
* Lists Clusters in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listClusters(ListClustersRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listClusters(LocationName parent)
*
listClusters(String parent)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* listClustersPagedCallable()
*
listClustersCallable()
*
*
*
*
* GetCluster
* Gets details of a single Cluster.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getCluster(GetClusterRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getCluster(ClusterName name)
*
getCluster(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getClusterCallable()
*
*
*
*
* CreateCluster
* Creates a new Cluster in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createClusterAsync(CreateClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* createClusterAsync(LocationName parent, Cluster cluster, String clusterId)
*
createClusterAsync(String parent, Cluster cluster, String clusterId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createClusterOperationCallable()
*
createClusterCallable()
*
*
*
*
* UpdateCluster
* Updates the parameters of a single Cluster.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* updateClusterAsync(UpdateClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* updateClusterAsync(Cluster cluster, FieldMask updateMask)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* updateClusterOperationCallable()
*
updateClusterCallable()
*
*
*
*
* DeleteCluster
* Deletes a single Cluster.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteClusterAsync(DeleteClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteClusterAsync(ClusterName name)
*
deleteClusterAsync(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* deleteClusterOperationCallable()
*
deleteClusterCallable()
*
*
*
*
* ListStreams
* Lists Streams in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listStreams(ListStreamsRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listStreams(ClusterName parent)
*
listStreams(String parent)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* listStreamsPagedCallable()
*
listStreamsCallable()
*
*
*
*
* GetStream
* Gets details of a single Stream.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getStream(GetStreamRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getStream(StreamName name)
*
getStream(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getStreamCallable()
*
*
*
*
* CreateStream
* Creates a new Stream in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createStreamAsync(CreateStreamRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* createStreamAsync(ClusterName parent, Stream stream, String streamId)
*
createStreamAsync(String parent, Stream stream, String streamId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createStreamOperationCallable()
*
createStreamCallable()
*
*
*
*
* UpdateStream
* Updates the parameters of a single Stream.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* updateStreamAsync(UpdateStreamRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* updateStreamAsync(Stream stream, FieldMask updateMask)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* updateStreamOperationCallable()
*
updateStreamCallable()
*
*
*
*
* DeleteStream
* Deletes a single Stream.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteStreamAsync(DeleteStreamRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteStreamAsync(StreamName name)
*
deleteStreamAsync(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* deleteStreamOperationCallable()
*
deleteStreamCallable()
*
*
*
*
* GetStreamThumbnail
* Gets the thumbnail (image snapshot) of a single Stream.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getStreamThumbnailAsync(GetStreamThumbnailRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* getStreamThumbnailAsync(String stream, String gcsObjectName)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getStreamThumbnailOperationCallable()
*
getStreamThumbnailCallable()
*
*
*
*
* GenerateStreamHlsToken
* Generate the JWT auth token required to get the stream HLS contents.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* generateStreamHlsToken(GenerateStreamHlsTokenRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* generateStreamHlsToken(String stream)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* generateStreamHlsTokenCallable()
*
*
*
*
* ListEvents
* Lists Events in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listEvents(ListEventsRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listEvents(ClusterName parent)
*
listEvents(String parent)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* listEventsPagedCallable()
*
listEventsCallable()
*
*
*
*
* GetEvent
* Gets details of a single Event.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getEvent(GetEventRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getEvent(EventName name)
*
getEvent(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getEventCallable()
*
*
*
*
* CreateEvent
* Creates a new Event in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createEventAsync(CreateEventRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* createEventAsync(ClusterName parent, Event event, String eventId)
*
createEventAsync(String parent, Event event, String eventId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createEventOperationCallable()
*
createEventCallable()
*
*
*
*
* UpdateEvent
* Updates the parameters of a single Event.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* updateEventAsync(UpdateEventRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* updateEventAsync(Event event, FieldMask updateMask)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* updateEventOperationCallable()
*
updateEventCallable()
*
*
*
*
* DeleteEvent
* Deletes a single Event.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteEventAsync(DeleteEventRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteEventAsync(EventName name)
*
deleteEventAsync(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* deleteEventOperationCallable()
*
deleteEventCallable()
*
*
*
*
* ListSeries
* Lists Series in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listSeries(ListSeriesRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listSeries(ClusterName parent)
*
listSeries(String parent)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* listSeriesPagedCallable()
*
listSeriesCallable()
*
*
*
*
* GetSeries
* Gets details of a single Series.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getSeries(GetSeriesRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getSeries(SeriesName name)
*
getSeries(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getSeriesCallable()
*
*
*
*
* CreateSeries
* Creates a new Series in a given project and location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createSeriesAsync(CreateSeriesRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* createSeriesAsync(ClusterName parent, Series series, String seriesId)
*
createSeriesAsync(String parent, Series series, String seriesId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createSeriesOperationCallable()
*
createSeriesCallable()
*
*
*
*
* UpdateSeries
* Updates the parameters of a single Event.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* updateSeriesAsync(UpdateSeriesRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* updateSeriesAsync(Series series, FieldMask updateMask)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* updateSeriesOperationCallable()
*
updateSeriesCallable()
*
*
*
*
* DeleteSeries
* Deletes a single Series.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteSeriesAsync(DeleteSeriesRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteSeriesAsync(SeriesName name)
*
deleteSeriesAsync(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* deleteSeriesOperationCallable()
*
deleteSeriesCallable()
*
*
*
*
* MaterializeChannel
* Materialize a channel.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* materializeChannelAsync(MaterializeChannelRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* materializeChannelAsync(ClusterName parent, Channel channel, String channelId)
*
materializeChannelAsync(String parent, Channel channel, String channelId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* materializeChannelOperationCallable()
*
materializeChannelCallable()
*
*
*
*
*
* See the individual methods for example code.
*
*
Many parameters require resource names to be formatted in a particular way. To assist with
* these names, this class includes a format method for each type of name, and additionally a parse
* method to extract the individual identifiers contained within names that are returned.
*
*
This class can be customized by passing in a custom instance of StreamsServiceSettings to
* create(). For example:
*
*
To customize credentials:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* StreamsServiceSettings streamsServiceSettings =
* StreamsServiceSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* StreamsServiceClient streamsServiceClient = StreamsServiceClient.create(streamsServiceSettings);
* }
*
* To customize the endpoint:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* StreamsServiceSettings streamsServiceSettings =
* StreamsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
* StreamsServiceClient streamsServiceClient = StreamsServiceClient.create(streamsServiceSettings);
* }
*
* To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* StreamsServiceSettings streamsServiceSettings =
* StreamsServiceSettings.newHttpJsonBuilder().build();
* StreamsServiceClient streamsServiceClient = StreamsServiceClient.create(streamsServiceSettings);
* }
*
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class StreamsServiceClient implements BackgroundResource {
private final StreamsServiceSettings settings;
private final StreamsServiceStub stub;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of StreamsServiceClient with default settings. */
public static final StreamsServiceClient create() throws IOException {
return create(StreamsServiceSettings.newBuilder().build());
}
/**
* Constructs an instance of StreamsServiceClient, using the given settings. The channels are
* created based on the settings passed in, or defaults for any settings that are not set.
*/
public static final StreamsServiceClient create(StreamsServiceSettings settings)
throws IOException {
return new StreamsServiceClient(settings);
}
/**
* Constructs an instance of StreamsServiceClient, using the given stub for making calls. This is
* for advanced usage - prefer using create(StreamsServiceSettings).
*/
public static final StreamsServiceClient create(StreamsServiceStub stub) {
return new StreamsServiceClient(stub);
}
/**
* Constructs an instance of StreamsServiceClient, 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 StreamsServiceClient(StreamsServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((StreamsServiceStubSettings) settings.getStubSettings()).createStub();
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected StreamsServiceClient(StreamsServiceStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final StreamsServiceSettings getSettings() {
return settings;
}
public StreamsServiceStub getStub() {
return stub;
}
/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
@BetaApi
public final OperationsClient getHttpJsonOperationsClient() {
return httpJsonOperationsClient;
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Clusters in a given project and location.
*
*
Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* for (Cluster element : streamsServiceClient.listClusters(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListClustersRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListClustersPagedResponse listClusters(LocationName parent) {
ListClustersRequest request =
ListClustersRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listClusters(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Clusters in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* for (Cluster element : streamsServiceClient.listClusters(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListClustersRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListClustersPagedResponse listClusters(String parent) {
ListClustersRequest request = ListClustersRequest.newBuilder().setParent(parent).build();
return listClusters(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Clusters in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListClustersRequest request =
* ListClustersRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* for (Cluster element : streamsServiceClient.listClusters(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListClustersPagedResponse listClusters(ListClustersRequest request) {
return listClustersPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Clusters in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListClustersRequest request =
* ListClustersRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* ApiFuture future =
* streamsServiceClient.listClustersPagedCallable().futureCall(request);
* // Do something.
* for (Cluster element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable
listClustersPagedCallable() {
return stub.listClustersPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Clusters in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListClustersRequest request =
* ListClustersRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* while (true) {
* ListClustersResponse response = streamsServiceClient.listClustersCallable().call(request);
* for (Cluster element : response.getClustersList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable listClustersCallable() {
return stub.listClustersCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* Cluster response = streamsServiceClient.getCluster(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Cluster getCluster(ClusterName name) {
GetClusterRequest request =
GetClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getCluster(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* Cluster response = streamsServiceClient.getCluster(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Cluster getCluster(String name) {
GetClusterRequest request = GetClusterRequest.newBuilder().setName(name).build();
return getCluster(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetClusterRequest request =
* GetClusterRequest.newBuilder()
* .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .build();
* Cluster response = streamsServiceClient.getCluster(request);
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Cluster getCluster(GetClusterRequest request) {
return getClusterCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetClusterRequest request =
* GetClusterRequest.newBuilder()
* .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .build();
* ApiFuture future = streamsServiceClient.getClusterCallable().futureCall(request);
* // Do something.
* Cluster response = future.get();
* }
* }
*/
public final UnaryCallable getClusterCallable() {
return stub.getClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Cluster in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* Cluster cluster = Cluster.newBuilder().build();
* String clusterId = "clusterId561939637";
* Cluster response = streamsServiceClient.createClusterAsync(parent, cluster, clusterId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param cluster Required. The resource being created.
* @param clusterId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createClusterAsync(
LocationName parent, Cluster cluster, String clusterId) {
CreateClusterRequest request =
CreateClusterRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setCluster(cluster)
.setClusterId(clusterId)
.build();
return createClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Cluster in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* Cluster cluster = Cluster.newBuilder().build();
* String clusterId = "clusterId561939637";
* Cluster response = streamsServiceClient.createClusterAsync(parent, cluster, clusterId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param cluster Required. The resource being created.
* @param clusterId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createClusterAsync(
String parent, Cluster cluster, String clusterId) {
CreateClusterRequest request =
CreateClusterRequest.newBuilder()
.setParent(parent)
.setCluster(cluster)
.setClusterId(clusterId)
.build();
return createClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Cluster in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateClusterRequest request =
* CreateClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setClusterId("clusterId561939637")
* .setCluster(Cluster.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Cluster response = streamsServiceClient.createClusterAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createClusterAsync(
CreateClusterRequest request) {
return createClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Cluster in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateClusterRequest request =
* CreateClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setClusterId("clusterId561939637")
* .setCluster(Cluster.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.createClusterOperationCallable().futureCall(request);
* // Do something.
* Cluster response = future.get();
* }
* }
*/
public final OperationCallable
createClusterOperationCallable() {
return stub.createClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Cluster in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateClusterRequest request =
* CreateClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setClusterId("clusterId561939637")
* .setCluster(Cluster.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future =
* streamsServiceClient.createClusterCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable createClusterCallable() {
return stub.createClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* Cluster cluster = Cluster.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* Cluster response = streamsServiceClient.updateClusterAsync(cluster, updateMask).get();
* }
* }
*
* @param cluster Required. The resource being updated
* @param updateMask Required. Field mask is used to specify the fields to be overwritten in the
* Cluster resource by the update. The fields specified in the update_mask are relative to the
* resource, not the full request. A field will be overwritten if it is in the mask. If the
* user does not provide a mask then all fields will be overwritten.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateClusterAsync(
Cluster cluster, FieldMask updateMask) {
UpdateClusterRequest request =
UpdateClusterRequest.newBuilder().setCluster(cluster).setUpdateMask(updateMask).build();
return updateClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateClusterRequest request =
* UpdateClusterRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCluster(Cluster.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Cluster response = streamsServiceClient.updateClusterAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateClusterAsync(
UpdateClusterRequest request) {
return updateClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateClusterRequest request =
* UpdateClusterRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCluster(Cluster.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.updateClusterOperationCallable().futureCall(request);
* // Do something.
* Cluster response = future.get();
* }
* }
*/
public final OperationCallable
updateClusterOperationCallable() {
return stub.updateClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateClusterRequest request =
* UpdateClusterRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setCluster(Cluster.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future =
* streamsServiceClient.updateClusterCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable updateClusterCallable() {
return stub.updateClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* streamsServiceClient.deleteClusterAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteClusterAsync(ClusterName name) {
DeleteClusterRequest request =
DeleteClusterRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* streamsServiceClient.deleteClusterAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteClusterAsync(String name) {
DeleteClusterRequest request = DeleteClusterRequest.newBuilder().setName(name).build();
return deleteClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteClusterRequest request =
* DeleteClusterRequest.newBuilder()
* .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setRequestId("requestId693933066")
* .build();
* streamsServiceClient.deleteClusterAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteClusterAsync(
DeleteClusterRequest request) {
return deleteClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteClusterRequest request =
* DeleteClusterRequest.newBuilder()
* .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.deleteClusterOperationCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteClusterOperationCallable() {
return stub.deleteClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Cluster.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteClusterRequest request =
* DeleteClusterRequest.newBuilder()
* .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future =
* streamsServiceClient.deleteClusterCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable deleteClusterCallable() {
return stub.deleteClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Streams in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* for (Stream element : streamsServiceClient.listStreams(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListStreamsRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListStreamsPagedResponse listStreams(ClusterName parent) {
ListStreamsRequest request =
ListStreamsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listStreams(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Streams in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* for (Stream element : streamsServiceClient.listStreams(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListStreamsRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListStreamsPagedResponse listStreams(String parent) {
ListStreamsRequest request = ListStreamsRequest.newBuilder().setParent(parent).build();
return listStreams(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Streams in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListStreamsRequest request =
* ListStreamsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* for (Stream element : streamsServiceClient.listStreams(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListStreamsPagedResponse listStreams(ListStreamsRequest request) {
return listStreamsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Streams in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListStreamsRequest request =
* ListStreamsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* ApiFuture future =
* streamsServiceClient.listStreamsPagedCallable().futureCall(request);
* // Do something.
* for (Stream element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable
listStreamsPagedCallable() {
return stub.listStreamsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Streams in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListStreamsRequest request =
* ListStreamsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* while (true) {
* ListStreamsResponse response = streamsServiceClient.listStreamsCallable().call(request);
* for (Stream element : response.getStreamsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable listStreamsCallable() {
return stub.listStreamsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* StreamName name = StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]");
* Stream response = streamsServiceClient.getStream(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Stream getStream(StreamName name) {
GetStreamRequest request =
GetStreamRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getStream(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString();
* Stream response = streamsServiceClient.getStream(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Stream getStream(String name) {
GetStreamRequest request = GetStreamRequest.newBuilder().setName(name).build();
return getStream(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetStreamRequest request =
* GetStreamRequest.newBuilder()
* .setName(StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString())
* .build();
* Stream response = streamsServiceClient.getStream(request);
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Stream getStream(GetStreamRequest request) {
return getStreamCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetStreamRequest request =
* GetStreamRequest.newBuilder()
* .setName(StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString())
* .build();
* ApiFuture future = streamsServiceClient.getStreamCallable().futureCall(request);
* // Do something.
* Stream response = future.get();
* }
* }
*/
public final UnaryCallable getStreamCallable() {
return stub.getStreamCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Stream in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* Stream stream = Stream.newBuilder().build();
* String streamId = "streamId1790933179";
* Stream response = streamsServiceClient.createStreamAsync(parent, stream, streamId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param stream Required. The resource being created.
* @param streamId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createStreamAsync(
ClusterName parent, Stream stream, String streamId) {
CreateStreamRequest request =
CreateStreamRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setStream(stream)
.setStreamId(streamId)
.build();
return createStreamAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Stream in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* Stream stream = Stream.newBuilder().build();
* String streamId = "streamId1790933179";
* Stream response = streamsServiceClient.createStreamAsync(parent, stream, streamId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param stream Required. The resource being created.
* @param streamId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createStreamAsync(
String parent, Stream stream, String streamId) {
CreateStreamRequest request =
CreateStreamRequest.newBuilder()
.setParent(parent)
.setStream(stream)
.setStreamId(streamId)
.build();
return createStreamAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Stream in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateStreamRequest request =
* CreateStreamRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setStreamId("streamId1790933179")
* .setStream(Stream.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Stream response = streamsServiceClient.createStreamAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createStreamAsync(
CreateStreamRequest request) {
return createStreamOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Stream in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateStreamRequest request =
* CreateStreamRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setStreamId("streamId1790933179")
* .setStream(Stream.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.createStreamOperationCallable().futureCall(request);
* // Do something.
* Stream response = future.get();
* }
* }
*/
public final OperationCallable
createStreamOperationCallable() {
return stub.createStreamOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Stream in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateStreamRequest request =
* CreateStreamRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setStreamId("streamId1790933179")
* .setStream(Stream.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.createStreamCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable createStreamCallable() {
return stub.createStreamCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* Stream stream = Stream.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* Stream response = streamsServiceClient.updateStreamAsync(stream, updateMask).get();
* }
* }
*
* @param stream Required. The resource being updated.
* @param updateMask Required. Field mask is used to specify the fields to be overwritten in the
* Stream resource by the update. The fields specified in the update_mask are relative to the
* resource, not the full request. A field will be overwritten if it is in the mask. If the
* user does not provide a mask then all fields will be overwritten.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateStreamAsync(
Stream stream, FieldMask updateMask) {
UpdateStreamRequest request =
UpdateStreamRequest.newBuilder().setStream(stream).setUpdateMask(updateMask).build();
return updateStreamAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateStreamRequest request =
* UpdateStreamRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setStream(Stream.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Stream response = streamsServiceClient.updateStreamAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateStreamAsync(
UpdateStreamRequest request) {
return updateStreamOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateStreamRequest request =
* UpdateStreamRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setStream(Stream.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.updateStreamOperationCallable().futureCall(request);
* // Do something.
* Stream response = future.get();
* }
* }
*/
public final OperationCallable
updateStreamOperationCallable() {
return stub.updateStreamOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateStreamRequest request =
* UpdateStreamRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setStream(Stream.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.updateStreamCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable updateStreamCallable() {
return stub.updateStreamCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* StreamName name = StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]");
* streamsServiceClient.deleteStreamAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteStreamAsync(StreamName name) {
DeleteStreamRequest request =
DeleteStreamRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteStreamAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString();
* streamsServiceClient.deleteStreamAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteStreamAsync(String name) {
DeleteStreamRequest request = DeleteStreamRequest.newBuilder().setName(name).build();
return deleteStreamAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteStreamRequest request =
* DeleteStreamRequest.newBuilder()
* .setName(StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString())
* .setRequestId("requestId693933066")
* .build();
* streamsServiceClient.deleteStreamAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteStreamAsync(
DeleteStreamRequest request) {
return deleteStreamOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteStreamRequest request =
* DeleteStreamRequest.newBuilder()
* .setName(StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.deleteStreamOperationCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteStreamOperationCallable() {
return stub.deleteStreamOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteStreamRequest request =
* DeleteStreamRequest.newBuilder()
* .setName(StreamName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[STREAM]").toString())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.deleteStreamCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable deleteStreamCallable() {
return stub.deleteStreamCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the thumbnail (image snapshot) of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String stream = "stream-891990144";
* String gcsObjectName = "gcsObjectName-1987275551";
* GetStreamThumbnailResponse response =
* streamsServiceClient.getStreamThumbnailAsync(stream, gcsObjectName).get();
* }
* }
*
* @param stream Required. The name of the stream for to get the thumbnail from.
* @param gcsObjectName Required. The name of the GCS object to store the thumbnail image.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture
getStreamThumbnailAsync(String stream, String gcsObjectName) {
GetStreamThumbnailRequest request =
GetStreamThumbnailRequest.newBuilder()
.setStream(stream)
.setGcsObjectName(gcsObjectName)
.build();
return getStreamThumbnailAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the thumbnail (image snapshot) of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetStreamThumbnailRequest request =
* GetStreamThumbnailRequest.newBuilder()
* .setStream("stream-891990144")
* .setGcsObjectName("gcsObjectName-1987275551")
* .setEvent("event96891546")
* .setRequestId("requestId693933066")
* .build();
* GetStreamThumbnailResponse response =
* streamsServiceClient.getStreamThumbnailAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture
getStreamThumbnailAsync(GetStreamThumbnailRequest request) {
return getStreamThumbnailOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the thumbnail (image snapshot) of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetStreamThumbnailRequest request =
* GetStreamThumbnailRequest.newBuilder()
* .setStream("stream-891990144")
* .setGcsObjectName("gcsObjectName-1987275551")
* .setEvent("event96891546")
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.getStreamThumbnailOperationCallable().futureCall(request);
* // Do something.
* GetStreamThumbnailResponse response = future.get();
* }
* }
*/
public final OperationCallable<
GetStreamThumbnailRequest, GetStreamThumbnailResponse, OperationMetadata>
getStreamThumbnailOperationCallable() {
return stub.getStreamThumbnailOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the thumbnail (image snapshot) of a single Stream.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetStreamThumbnailRequest request =
* GetStreamThumbnailRequest.newBuilder()
* .setStream("stream-891990144")
* .setGcsObjectName("gcsObjectName-1987275551")
* .setEvent("event96891546")
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future =
* streamsServiceClient.getStreamThumbnailCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable getStreamThumbnailCallable() {
return stub.getStreamThumbnailCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate the JWT auth token required to get the stream HLS contents.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String stream = "stream-891990144";
* GenerateStreamHlsTokenResponse response = streamsServiceClient.generateStreamHlsToken(stream);
* }
* }
*
* @param stream Required. The name of the stream.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GenerateStreamHlsTokenResponse generateStreamHlsToken(String stream) {
GenerateStreamHlsTokenRequest request =
GenerateStreamHlsTokenRequest.newBuilder().setStream(stream).build();
return generateStreamHlsToken(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate the JWT auth token required to get the stream HLS contents.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GenerateStreamHlsTokenRequest request =
* GenerateStreamHlsTokenRequest.newBuilder().setStream("stream-891990144").build();
* GenerateStreamHlsTokenResponse response =
* streamsServiceClient.generateStreamHlsToken(request);
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GenerateStreamHlsTokenResponse generateStreamHlsToken(
GenerateStreamHlsTokenRequest request) {
return generateStreamHlsTokenCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generate the JWT auth token required to get the stream HLS contents.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GenerateStreamHlsTokenRequest request =
* GenerateStreamHlsTokenRequest.newBuilder().setStream("stream-891990144").build();
* ApiFuture future =
* streamsServiceClient.generateStreamHlsTokenCallable().futureCall(request);
* // Do something.
* GenerateStreamHlsTokenResponse response = future.get();
* }
* }
*/
public final UnaryCallable
generateStreamHlsTokenCallable() {
return stub.generateStreamHlsTokenCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Events in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* for (Event element : streamsServiceClient.listEvents(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListEventsRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEventsPagedResponse listEvents(ClusterName parent) {
ListEventsRequest request =
ListEventsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
return listEvents(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Events in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* for (Event element : streamsServiceClient.listEvents(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListEventsRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEventsPagedResponse listEvents(String parent) {
ListEventsRequest request = ListEventsRequest.newBuilder().setParent(parent).build();
return listEvents(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Events in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListEventsRequest request =
* ListEventsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* for (Event element : streamsServiceClient.listEvents(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEventsPagedResponse listEvents(ListEventsRequest request) {
return listEventsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Events in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListEventsRequest request =
* ListEventsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* ApiFuture future = streamsServiceClient.listEventsPagedCallable().futureCall(request);
* // Do something.
* for (Event element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable listEventsPagedCallable() {
return stub.listEventsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Events in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListEventsRequest request =
* ListEventsRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* while (true) {
* ListEventsResponse response = streamsServiceClient.listEventsCallable().call(request);
* for (Event element : response.getEventsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable listEventsCallable() {
return stub.listEventsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]");
* Event response = streamsServiceClient.getEvent(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Event getEvent(EventName name) {
GetEventRequest request =
GetEventRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getEvent(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString();
* Event response = streamsServiceClient.getEvent(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Event getEvent(String name) {
GetEventRequest request = GetEventRequest.newBuilder().setName(name).build();
return getEvent(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetEventRequest request =
* GetEventRequest.newBuilder()
* .setName(EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString())
* .build();
* Event response = streamsServiceClient.getEvent(request);
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Event getEvent(GetEventRequest request) {
return getEventCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetEventRequest request =
* GetEventRequest.newBuilder()
* .setName(EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString())
* .build();
* ApiFuture future = streamsServiceClient.getEventCallable().futureCall(request);
* // Do something.
* Event response = future.get();
* }
* }
*/
public final UnaryCallable getEventCallable() {
return stub.getEventCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Event in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* Event event = Event.newBuilder().build();
* String eventId = "eventId-1376502443";
* Event response = streamsServiceClient.createEventAsync(parent, event, eventId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param event Required. The resource being created.
* @param eventId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createEventAsync(
ClusterName parent, Event event, String eventId) {
CreateEventRequest request =
CreateEventRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setEvent(event)
.setEventId(eventId)
.build();
return createEventAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Event in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* Event event = Event.newBuilder().build();
* String eventId = "eventId-1376502443";
* Event response = streamsServiceClient.createEventAsync(parent, event, eventId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param event Required. The resource being created.
* @param eventId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createEventAsync(
String parent, Event event, String eventId) {
CreateEventRequest request =
CreateEventRequest.newBuilder()
.setParent(parent)
.setEvent(event)
.setEventId(eventId)
.build();
return createEventAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Event in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateEventRequest request =
* CreateEventRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setEventId("eventId-1376502443")
* .setEvent(Event.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Event response = streamsServiceClient.createEventAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createEventAsync(
CreateEventRequest request) {
return createEventOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Event in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateEventRequest request =
* CreateEventRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setEventId("eventId-1376502443")
* .setEvent(Event.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.createEventOperationCallable().futureCall(request);
* // Do something.
* Event response = future.get();
* }
* }
*/
public final OperationCallable
createEventOperationCallable() {
return stub.createEventOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Event in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateEventRequest request =
* CreateEventRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setEventId("eventId-1376502443")
* .setEvent(Event.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.createEventCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable createEventCallable() {
return stub.createEventCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* Event event = Event.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* Event response = streamsServiceClient.updateEventAsync(event, updateMask).get();
* }
* }
*
* @param event Required. The resource being updated.
* @param updateMask Required. Field mask is used to specify the fields to be overwritten in the
* Event resource by the update. The fields specified in the update_mask are relative to the
* resource, not the full request. A field will be overwritten if it is in the mask. If the
* user does not provide a mask then all fields will be overwritten.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateEventAsync(
Event event, FieldMask updateMask) {
UpdateEventRequest request =
UpdateEventRequest.newBuilder().setEvent(event).setUpdateMask(updateMask).build();
return updateEventAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateEventRequest request =
* UpdateEventRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setEvent(Event.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Event response = streamsServiceClient.updateEventAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateEventAsync(
UpdateEventRequest request) {
return updateEventOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateEventRequest request =
* UpdateEventRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setEvent(Event.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.updateEventOperationCallable().futureCall(request);
* // Do something.
* Event response = future.get();
* }
* }
*/
public final OperationCallable
updateEventOperationCallable() {
return stub.updateEventOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateEventRequest request =
* UpdateEventRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setEvent(Event.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.updateEventCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable updateEventCallable() {
return stub.updateEventCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* EventName name = EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]");
* streamsServiceClient.deleteEventAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteEventAsync(EventName name) {
DeleteEventRequest request =
DeleteEventRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteEventAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString();
* streamsServiceClient.deleteEventAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteEventAsync(String name) {
DeleteEventRequest request = DeleteEventRequest.newBuilder().setName(name).build();
return deleteEventAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteEventRequest request =
* DeleteEventRequest.newBuilder()
* .setName(EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString())
* .setRequestId("requestId693933066")
* .build();
* streamsServiceClient.deleteEventAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteEventAsync(
DeleteEventRequest request) {
return deleteEventOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteEventRequest request =
* DeleteEventRequest.newBuilder()
* .setName(EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.deleteEventOperationCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteEventOperationCallable() {
return stub.deleteEventOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteEventRequest request =
* DeleteEventRequest.newBuilder()
* .setName(EventName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[EVENT]").toString())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.deleteEventCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable deleteEventCallable() {
return stub.deleteEventCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* for (Series element : streamsServiceClient.listSeries(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListSeriesRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListSeriesPagedResponse listSeries(ClusterName parent) {
ListSeriesRequest request =
ListSeriesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build();
return listSeries(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* for (Series element : streamsServiceClient.listSeries(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. Parent value for ListSeriesRequest.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListSeriesPagedResponse listSeries(String parent) {
ListSeriesRequest request = ListSeriesRequest.newBuilder().setParent(parent).build();
return listSeries(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListSeriesRequest request =
* ListSeriesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* for (Series element : streamsServiceClient.listSeries(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListSeriesPagedResponse listSeries(ListSeriesRequest request) {
return listSeriesPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListSeriesRequest request =
* ListSeriesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* ApiFuture future = streamsServiceClient.listSeriesPagedCallable().futureCall(request);
* // Do something.
* for (Series element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable listSeriesPagedCallable() {
return stub.listSeriesPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ListSeriesRequest request =
* ListSeriesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .setOrderBy("orderBy-1207110587")
* .build();
* while (true) {
* ListSeriesResponse response = streamsServiceClient.listSeriesCallable().call(request);
* for (Series element : response.getSeriesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable listSeriesCallable() {
return stub.listSeriesCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* SeriesName name = SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]");
* Series response = streamsServiceClient.getSeries(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Series getSeries(SeriesName name) {
GetSeriesRequest request =
GetSeriesRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getSeries(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString();
* Series response = streamsServiceClient.getSeries(name);
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Series getSeries(String name) {
GetSeriesRequest request = GetSeriesRequest.newBuilder().setName(name).build();
return getSeries(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetSeriesRequest request =
* GetSeriesRequest.newBuilder()
* .setName(SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString())
* .build();
* Series response = streamsServiceClient.getSeries(request);
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Series getSeries(GetSeriesRequest request) {
return getSeriesCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets details of a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* GetSeriesRequest request =
* GetSeriesRequest.newBuilder()
* .setName(SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString())
* .build();
* ApiFuture future = streamsServiceClient.getSeriesCallable().futureCall(request);
* // Do something.
* Series response = future.get();
* }
* }
*/
public final UnaryCallable getSeriesCallable() {
return stub.getSeriesCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* Series series = Series.newBuilder().build();
* String seriesId = "seriesId1367098866";
* Series response = streamsServiceClient.createSeriesAsync(parent, series, seriesId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param series Required. The resource being created.
* @param seriesId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createSeriesAsync(
ClusterName parent, Series series, String seriesId) {
CreateSeriesRequest request =
CreateSeriesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setSeries(series)
.setSeriesId(seriesId)
.build();
return createSeriesAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* Series series = Series.newBuilder().build();
* String seriesId = "seriesId1367098866";
* Series response = streamsServiceClient.createSeriesAsync(parent, series, seriesId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param series Required. The resource being created.
* @param seriesId Required. Id of the requesting object.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createSeriesAsync(
String parent, Series series, String seriesId) {
CreateSeriesRequest request =
CreateSeriesRequest.newBuilder()
.setParent(parent)
.setSeries(series)
.setSeriesId(seriesId)
.build();
return createSeriesAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateSeriesRequest request =
* CreateSeriesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setSeriesId("seriesId1367098866")
* .setSeries(Series.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Series response = streamsServiceClient.createSeriesAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createSeriesAsync(
CreateSeriesRequest request) {
return createSeriesOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateSeriesRequest request =
* CreateSeriesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setSeriesId("seriesId1367098866")
* .setSeries(Series.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.createSeriesOperationCallable().futureCall(request);
* // Do something.
* Series response = future.get();
* }
* }
*/
public final OperationCallable
createSeriesOperationCallable() {
return stub.createSeriesOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new Series in a given project and location.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* CreateSeriesRequest request =
* CreateSeriesRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setSeriesId("seriesId1367098866")
* .setSeries(Series.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.createSeriesCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable createSeriesCallable() {
return stub.createSeriesCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* Series series = Series.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* Series response = streamsServiceClient.updateSeriesAsync(series, updateMask).get();
* }
* }
*
* @param series Required. The resource being updated
* @param updateMask Required. Field mask is used to specify the fields to be overwritten in the
* Series resource by the update. The fields specified in the update_mask are relative to the
* resource, not the full request. A field will be overwritten if it is in the mask. If the
* user does not provide a mask then all fields will be overwritten.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateSeriesAsync(
Series series, FieldMask updateMask) {
UpdateSeriesRequest request =
UpdateSeriesRequest.newBuilder().setSeries(series).setUpdateMask(updateMask).build();
return updateSeriesAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateSeriesRequest request =
* UpdateSeriesRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setSeries(Series.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Series response = streamsServiceClient.updateSeriesAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateSeriesAsync(
UpdateSeriesRequest request) {
return updateSeriesOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateSeriesRequest request =
* UpdateSeriesRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setSeries(Series.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.updateSeriesOperationCallable().futureCall(request);
* // Do something.
* Series response = future.get();
* }
* }
*/
public final OperationCallable
updateSeriesOperationCallable() {
return stub.updateSeriesOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates the parameters of a single Event.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* UpdateSeriesRequest request =
* UpdateSeriesRequest.newBuilder()
* .setUpdateMask(FieldMask.newBuilder().build())
* .setSeries(Series.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.updateSeriesCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable updateSeriesCallable() {
return stub.updateSeriesCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* SeriesName name = SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]");
* streamsServiceClient.deleteSeriesAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteSeriesAsync(SeriesName name) {
DeleteSeriesRequest request =
DeleteSeriesRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteSeriesAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String name = SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString();
* streamsServiceClient.deleteSeriesAsync(name).get();
* }
* }
*
* @param name Required. Name of the resource.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteSeriesAsync(String name) {
DeleteSeriesRequest request = DeleteSeriesRequest.newBuilder().setName(name).build();
return deleteSeriesAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteSeriesRequest request =
* DeleteSeriesRequest.newBuilder()
* .setName(SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString())
* .setRequestId("requestId693933066")
* .build();
* streamsServiceClient.deleteSeriesAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteSeriesAsync(
DeleteSeriesRequest request) {
return deleteSeriesOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteSeriesRequest request =
* DeleteSeriesRequest.newBuilder()
* .setName(SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.deleteSeriesOperationCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteSeriesOperationCallable() {
return stub.deleteSeriesOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a single Series.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* DeleteSeriesRequest request =
* DeleteSeriesRequest.newBuilder()
* .setName(SeriesName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[SERIES]").toString())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future = streamsServiceClient.deleteSeriesCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable deleteSeriesCallable() {
return stub.deleteSeriesCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Materialize a channel.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
* Channel channel = Channel.newBuilder().build();
* String channelId = "channelId1461735806";
* Channel response =
* streamsServiceClient.materializeChannelAsync(parent, channel, channelId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param channel Required. The resource being created.
* @param channelId Required. Id of the channel.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture materializeChannelAsync(
ClusterName parent, Channel channel, String channelId) {
MaterializeChannelRequest request =
MaterializeChannelRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setChannel(channel)
.setChannelId(channelId)
.build();
return materializeChannelAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Materialize a channel.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
* Channel channel = Channel.newBuilder().build();
* String channelId = "channelId1461735806";
* Channel response =
* streamsServiceClient.materializeChannelAsync(parent, channel, channelId).get();
* }
* }
*
* @param parent Required. Value for parent.
* @param channel Required. The resource being created.
* @param channelId Required. Id of the channel.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture materializeChannelAsync(
String parent, Channel channel, String channelId) {
MaterializeChannelRequest request =
MaterializeChannelRequest.newBuilder()
.setParent(parent)
.setChannel(channel)
.setChannelId(channelId)
.build();
return materializeChannelAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Materialize a channel.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* MaterializeChannelRequest request =
* MaterializeChannelRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setChannelId("channelId1461735806")
* .setChannel(Channel.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* Channel response = streamsServiceClient.materializeChannelAsync(request).get();
* }
* }
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture materializeChannelAsync(
MaterializeChannelRequest request) {
return materializeChannelOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Materialize a channel.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* MaterializeChannelRequest request =
* MaterializeChannelRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setChannelId("channelId1461735806")
* .setChannel(Channel.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture future =
* streamsServiceClient.materializeChannelOperationCallable().futureCall(request);
* // Do something.
* Channel response = future.get();
* }
* }
*/
public final OperationCallable
materializeChannelOperationCallable() {
return stub.materializeChannelOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Materialize a channel.
*
* Sample code:
*
*
{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (StreamsServiceClient streamsServiceClient = StreamsServiceClient.create()) {
* MaterializeChannelRequest request =
* MaterializeChannelRequest.newBuilder()
* .setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
* .setChannelId("channelId1461735806")
* .setChannel(Channel.newBuilder().build())
* .setRequestId("requestId693933066")
* .build();
* ApiFuture future =
* streamsServiceClient.materializeChannelCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable materializeChannelCallable() {
return stub.materializeChannelCallable();
}
@Override
public final void close() {
stub.close();
}
@Override
public void shutdown() {
stub.shutdown();
}
@Override
public boolean isShutdown() {
return stub.isShutdown();
}
@Override
public boolean isTerminated() {
return stub.isTerminated();
}
@Override
public void shutdownNow() {
stub.shutdownNow();
}
@Override
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return stub.awaitTermination(duration, unit);
}
public static class ListClustersPagedResponse
extends AbstractPagedListResponse<
ListClustersRequest,
ListClustersResponse,
Cluster,
ListClustersPage,
ListClustersFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListClustersPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListClustersPagedResponse(input),
MoreExecutors.directExecutor());
}
private ListClustersPagedResponse(ListClustersPage page) {
super(page, ListClustersFixedSizeCollection.createEmptyCollection());
}
}
public static class ListClustersPage
extends AbstractPage {
private ListClustersPage(
PageContext context,
ListClustersResponse response) {
super(context, response);
}
private static ListClustersPage createEmptyPage() {
return new ListClustersPage(null, null);
}
@Override
protected ListClustersPage createPage(
PageContext context,
ListClustersResponse response) {
return new ListClustersPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListClustersFixedSizeCollection
extends AbstractFixedSizeCollection<
ListClustersRequest,
ListClustersResponse,
Cluster,
ListClustersPage,
ListClustersFixedSizeCollection> {
private ListClustersFixedSizeCollection(List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListClustersFixedSizeCollection createEmptyCollection() {
return new ListClustersFixedSizeCollection(null, 0);
}
@Override
protected ListClustersFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListClustersFixedSizeCollection(pages, collectionSize);
}
}
public static class ListStreamsPagedResponse
extends AbstractPagedListResponse<
ListStreamsRequest,
ListStreamsResponse,
Stream,
ListStreamsPage,
ListStreamsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListStreamsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage, input -> new ListStreamsPagedResponse(input), MoreExecutors.directExecutor());
}
private ListStreamsPagedResponse(ListStreamsPage page) {
super(page, ListStreamsFixedSizeCollection.createEmptyCollection());
}
}
public static class ListStreamsPage
extends AbstractPage {
private ListStreamsPage(
PageContext context,
ListStreamsResponse response) {
super(context, response);
}
private static ListStreamsPage createEmptyPage() {
return new ListStreamsPage(null, null);
}
@Override
protected ListStreamsPage createPage(
PageContext context,
ListStreamsResponse response) {
return new ListStreamsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListStreamsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListStreamsRequest,
ListStreamsResponse,
Stream,
ListStreamsPage,
ListStreamsFixedSizeCollection> {
private ListStreamsFixedSizeCollection(List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListStreamsFixedSizeCollection createEmptyCollection() {
return new ListStreamsFixedSizeCollection(null, 0);
}
@Override
protected ListStreamsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListStreamsFixedSizeCollection(pages, collectionSize);
}
}
public static class ListEventsPagedResponse
extends AbstractPagedListResponse<
ListEventsRequest,
ListEventsResponse,
Event,
ListEventsPage,
ListEventsFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListEventsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage, input -> new ListEventsPagedResponse(input), MoreExecutors.directExecutor());
}
private ListEventsPagedResponse(ListEventsPage page) {
super(page, ListEventsFixedSizeCollection.createEmptyCollection());
}
}
public static class ListEventsPage
extends AbstractPage {
private ListEventsPage(
PageContext context,
ListEventsResponse response) {
super(context, response);
}
private static ListEventsPage createEmptyPage() {
return new ListEventsPage(null, null);
}
@Override
protected ListEventsPage createPage(
PageContext context,
ListEventsResponse response) {
return new ListEventsPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListEventsFixedSizeCollection
extends AbstractFixedSizeCollection<
ListEventsRequest,
ListEventsResponse,
Event,
ListEventsPage,
ListEventsFixedSizeCollection> {
private ListEventsFixedSizeCollection(List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListEventsFixedSizeCollection createEmptyCollection() {
return new ListEventsFixedSizeCollection(null, 0);
}
@Override
protected ListEventsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListEventsFixedSizeCollection(pages, collectionSize);
}
}
public static class ListSeriesPagedResponse
extends AbstractPagedListResponse<
ListSeriesRequest,
ListSeriesResponse,
Series,
ListSeriesPage,
ListSeriesFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListSeriesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage, input -> new ListSeriesPagedResponse(input), MoreExecutors.directExecutor());
}
private ListSeriesPagedResponse(ListSeriesPage page) {
super(page, ListSeriesFixedSizeCollection.createEmptyCollection());
}
}
public static class ListSeriesPage
extends AbstractPage {
private ListSeriesPage(
PageContext context,
ListSeriesResponse response) {
super(context, response);
}
private static ListSeriesPage createEmptyPage() {
return new ListSeriesPage(null, null);
}
@Override
protected ListSeriesPage createPage(
PageContext context,
ListSeriesResponse response) {
return new ListSeriesPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListSeriesFixedSizeCollection
extends AbstractFixedSizeCollection<
ListSeriesRequest,
ListSeriesResponse,
Series,
ListSeriesPage,
ListSeriesFixedSizeCollection> {
private ListSeriesFixedSizeCollection(List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListSeriesFixedSizeCollection createEmptyCollection() {
return new ListSeriesFixedSizeCollection(null, 0);
}
@Override
protected ListSeriesFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListSeriesFixedSizeCollection(pages, collectionSize);
}
}
}