@BetaApi @Generated(value="by gapic-generator-java") public class DatastreamClient extends Object implements com.google.api.gax.core.BackgroundResource
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:
// 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ConnectionProfileName name =
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]");
ConnectionProfile response = datastreamClient.getConnectionProfile(name);
}
Note: close() needs to be called on the DatastreamClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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 DatastreamSettings to create(). For example:
To customize credentials:
// 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
DatastreamSettings datastreamSettings =
DatastreamSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DatastreamClient datastreamClient = DatastreamClient.create(datastreamSettings);
To customize the endpoint:
// 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
DatastreamSettings datastreamSettings =
DatastreamSettings.newBuilder().setEndpoint(myEndpoint).build();
DatastreamClient datastreamClient = DatastreamClient.create(datastreamSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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
DatastreamSettings datastreamSettings = DatastreamSettings.newHttpJsonBuilder().build();
DatastreamClient datastreamClient = DatastreamClient.create(datastreamSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
DatastreamClient.FetchStaticIpsFixedSizeCollection |
static class |
DatastreamClient.FetchStaticIpsPage |
static class |
DatastreamClient.FetchStaticIpsPagedResponse |
static class |
DatastreamClient.ListConnectionProfilesFixedSizeCollection |
static class |
DatastreamClient.ListConnectionProfilesPage |
static class |
DatastreamClient.ListConnectionProfilesPagedResponse |
static class |
DatastreamClient.ListPrivateConnectionsFixedSizeCollection |
static class |
DatastreamClient.ListPrivateConnectionsPage |
static class |
DatastreamClient.ListPrivateConnectionsPagedResponse |
static class |
DatastreamClient.ListRoutesFixedSizeCollection |
static class |
DatastreamClient.ListRoutesPage |
static class |
DatastreamClient.ListRoutesPagedResponse |
static class |
DatastreamClient.ListStreamsFixedSizeCollection |
static class |
DatastreamClient.ListStreamsPage |
static class |
DatastreamClient.ListStreamsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
DatastreamClient(DatastreamSettings settings)
Constructs an instance of DatastreamClient, using the given settings.
|
protected |
DatastreamClient(DatastreamStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DatastreamClient |
create()
Constructs an instance of DatastreamClient with default settings.
|
static DatastreamClient |
create(DatastreamSettings settings)
Constructs an instance of DatastreamClient, using the given settings.
|
static DatastreamClient |
create(DatastreamStub stub)
Constructs an instance of DatastreamClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> |
createConnectionProfileAsync(CreateConnectionProfileRequest request)
Use this method to create a connection profile in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> |
createConnectionProfileAsync(LocationName parent,
ConnectionProfile connectionProfile,
String connectionProfileId)
Use this method to create a connection profile in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> |
createConnectionProfileAsync(String parent,
ConnectionProfile connectionProfile,
String connectionProfileId)
Use this method to create a connection profile in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateConnectionProfileRequest,com.google.longrunning.Operation> |
createConnectionProfileCallable()
Use this method to create a connection profile in a project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateConnectionProfileRequest,ConnectionProfile,OperationMetadata> |
createConnectionProfileOperationCallable()
Use this method to create a connection profile in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<PrivateConnection,OperationMetadata> |
createPrivateConnectionAsync(CreatePrivateConnectionRequest request)
Use this method to create a private connectivity configuration.
|
com.google.api.gax.longrunning.OperationFuture<PrivateConnection,OperationMetadata> |
createPrivateConnectionAsync(LocationName parent,
PrivateConnection privateConnection,
String privateConnectionId)
Use this method to create a private connectivity configuration.
|
com.google.api.gax.longrunning.OperationFuture<PrivateConnection,OperationMetadata> |
createPrivateConnectionAsync(String parent,
PrivateConnection privateConnection,
String privateConnectionId)
Use this method to create a private connectivity configuration.
|
com.google.api.gax.rpc.UnaryCallable<CreatePrivateConnectionRequest,com.google.longrunning.Operation> |
createPrivateConnectionCallable()
Use this method to create a private connectivity configuration.
|
com.google.api.gax.rpc.OperationCallable<CreatePrivateConnectionRequest,PrivateConnection,OperationMetadata> |
createPrivateConnectionOperationCallable()
Use this method to create a private connectivity configuration.
|
com.google.api.gax.longrunning.OperationFuture<Route,OperationMetadata> |
createRouteAsync(CreateRouteRequest request)
Use this method to create a route for a private connectivity in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<Route,OperationMetadata> |
createRouteAsync(PrivateConnectionName parent,
Route route,
String routeId)
Use this method to create a route for a private connectivity in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<Route,OperationMetadata> |
createRouteAsync(String parent,
Route route,
String routeId)
Use this method to create a route for a private connectivity in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateRouteRequest,com.google.longrunning.Operation> |
createRouteCallable()
Use this method to create a route for a private connectivity in a project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateRouteRequest,Route,OperationMetadata> |
createRouteOperationCallable()
Use this method to create a route for a private connectivity in a project and location.
|
com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> |
createStreamAsync(CreateStreamRequest request)
Use this method to create a stream.
|
com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> |
createStreamAsync(LocationName parent,
Stream stream,
String streamId)
Use this method to create a stream.
|
com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> |
createStreamAsync(String parent,
Stream stream,
String streamId)
Use this method to create a stream.
|
com.google.api.gax.rpc.UnaryCallable<CreateStreamRequest,com.google.longrunning.Operation> |
createStreamCallable()
Use this method to create a stream.
|
com.google.api.gax.rpc.OperationCallable<CreateStreamRequest,Stream,OperationMetadata> |
createStreamOperationCallable()
Use this method to create a stream.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionProfileAsync(ConnectionProfileName name)
Use this method to delete a connection profile..
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionProfileAsync(DeleteConnectionProfileRequest request)
Use this method to delete a connection profile..
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionProfileAsync(String name)
Use this method to delete a connection profile..
|
com.google.api.gax.rpc.UnaryCallable<DeleteConnectionProfileRequest,com.google.longrunning.Operation> |
deleteConnectionProfileCallable()
Use this method to delete a connection profile..
|
com.google.api.gax.rpc.OperationCallable<DeleteConnectionProfileRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteConnectionProfileOperationCallable()
Use this method to delete a connection profile..
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deletePrivateConnectionAsync(DeletePrivateConnectionRequest request)
Use this method to delete a private connectivity configuration.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deletePrivateConnectionAsync(PrivateConnectionName name)
Use this method to delete a private connectivity configuration.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deletePrivateConnectionAsync(String name)
Use this method to delete a private connectivity configuration.
|
com.google.api.gax.rpc.UnaryCallable<DeletePrivateConnectionRequest,com.google.longrunning.Operation> |
deletePrivateConnectionCallable()
Use this method to delete a private connectivity configuration.
|
com.google.api.gax.rpc.OperationCallable<DeletePrivateConnectionRequest,com.google.protobuf.Empty,OperationMetadata> |
deletePrivateConnectionOperationCallable()
Use this method to delete a private connectivity configuration.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRouteAsync(DeleteRouteRequest request)
Use this method to delete a route.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRouteAsync(RouteName name)
Use this method to delete a route.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteRouteAsync(String name)
Use this method to delete a route.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRouteRequest,com.google.longrunning.Operation> |
deleteRouteCallable()
Use this method to delete a route.
|
com.google.api.gax.rpc.OperationCallable<DeleteRouteRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteRouteOperationCallable()
Use this method to delete a route.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteStreamAsync(DeleteStreamRequest request)
Use this method to delete a stream.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteStreamAsync(StreamName name)
Use this method to delete a stream.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteStreamAsync(String name)
Use this method to delete a stream.
|
com.google.api.gax.rpc.UnaryCallable<DeleteStreamRequest,com.google.longrunning.Operation> |
deleteStreamCallable()
Use this method to delete a stream.
|
com.google.api.gax.rpc.OperationCallable<DeleteStreamRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteStreamOperationCallable()
Use this method to delete a stream.
|
DiscoverConnectionProfileResponse |
discoverConnectionProfile(DiscoverConnectionProfileRequest request)
Use this method to discover a connection profile.
|
com.google.api.gax.rpc.UnaryCallable<DiscoverConnectionProfileRequest,DiscoverConnectionProfileResponse> |
discoverConnectionProfileCallable()
Use this method to discover a connection profile.
|
com.google.api.gax.longrunning.OperationFuture<FetchErrorsResponse,OperationMetadata> |
fetchErrorsAsync(FetchErrorsRequest request)
Use this method to fetch any errors associated with a stream.
|
com.google.api.gax.rpc.UnaryCallable<FetchErrorsRequest,com.google.longrunning.Operation> |
fetchErrorsCallable()
Use this method to fetch any errors associated with a stream.
|
com.google.api.gax.rpc.OperationCallable<FetchErrorsRequest,FetchErrorsResponse,OperationMetadata> |
fetchErrorsOperationCallable()
Use this method to fetch any errors associated with a stream.
|
DatastreamClient.FetchStaticIpsPagedResponse |
fetchStaticIps(FetchStaticIpsRequest request)
The FetchStaticIps API call exposes the static ips used by Datastream.
|
DatastreamClient.FetchStaticIpsPagedResponse |
fetchStaticIps(LocationName name)
The FetchStaticIps API call exposes the static ips used by Datastream.
|
DatastreamClient.FetchStaticIpsPagedResponse |
fetchStaticIps(String name)
The FetchStaticIps API call exposes the static ips used by Datastream.
|
com.google.api.gax.rpc.UnaryCallable<FetchStaticIpsRequest,FetchStaticIpsResponse> |
fetchStaticIpsCallable()
The FetchStaticIps API call exposes the static ips used by Datastream.
|
com.google.api.gax.rpc.UnaryCallable<FetchStaticIpsRequest,DatastreamClient.FetchStaticIpsPagedResponse> |
fetchStaticIpsPagedCallable()
The FetchStaticIps API call exposes the static ips used by Datastream.
|
ConnectionProfile |
getConnectionProfile(ConnectionProfileName name)
Use this method to get details about a connection profile.
|
ConnectionProfile |
getConnectionProfile(GetConnectionProfileRequest request)
Use this method to get details about a connection profile.
|
ConnectionProfile |
getConnectionProfile(String name)
Use this method to get details about a connection profile.
|
com.google.api.gax.rpc.UnaryCallable<GetConnectionProfileRequest,ConnectionProfile> |
getConnectionProfileCallable()
Use this method to get details about a connection profile.
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
PrivateConnection |
getPrivateConnection(GetPrivateConnectionRequest request)
Use this method to get details about a private connectivity configuration.
|
PrivateConnection |
getPrivateConnection(PrivateConnectionName name)
Use this method to get details about a private connectivity configuration.
|
PrivateConnection |
getPrivateConnection(String name)
Use this method to get details about a private connectivity configuration.
|
com.google.api.gax.rpc.UnaryCallable<GetPrivateConnectionRequest,PrivateConnection> |
getPrivateConnectionCallable()
Use this method to get details about a private connectivity configuration.
|
Route |
getRoute(GetRouteRequest request)
Use this method to get details about a route.
|
Route |
getRoute(RouteName name)
Use this method to get details about a route.
|
Route |
getRoute(String name)
Use this method to get details about a route.
|
com.google.api.gax.rpc.UnaryCallable<GetRouteRequest,Route> |
getRouteCallable()
Use this method to get details about a route.
|
DatastreamSettings |
getSettings() |
Stream |
getStream(GetStreamRequest request)
Use this method to get details about a stream.
|
Stream |
getStream(StreamName name)
Use this method to get details about a stream.
|
Stream |
getStream(String name)
Use this method to get details about a stream.
|
com.google.api.gax.rpc.UnaryCallable<GetStreamRequest,Stream> |
getStreamCallable()
Use this method to get details about a stream.
|
DatastreamStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
DatastreamClient.ListConnectionProfilesPagedResponse |
listConnectionProfiles(ListConnectionProfilesRequest request)
Use this method to list connection profiles created in a project and location.
|
DatastreamClient.ListConnectionProfilesPagedResponse |
listConnectionProfiles(LocationName parent)
Use this method to list connection profiles created in a project and location.
|
DatastreamClient.ListConnectionProfilesPagedResponse |
listConnectionProfiles(String parent)
Use this method to list connection profiles created in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListConnectionProfilesRequest,ListConnectionProfilesResponse> |
listConnectionProfilesCallable()
Use this method to list connection profiles created in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListConnectionProfilesRequest,DatastreamClient.ListConnectionProfilesPagedResponse> |
listConnectionProfilesPagedCallable()
Use this method to list connection profiles created in a project and location.
|
DatastreamClient.ListPrivateConnectionsPagedResponse |
listPrivateConnections(ListPrivateConnectionsRequest request)
Use this method to list private connectivity configurations in a project and location.
|
DatastreamClient.ListPrivateConnectionsPagedResponse |
listPrivateConnections(LocationName parent)
Use this method to list private connectivity configurations in a project and location.
|
DatastreamClient.ListPrivateConnectionsPagedResponse |
listPrivateConnections(String parent)
Use this method to list private connectivity configurations in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListPrivateConnectionsRequest,ListPrivateConnectionsResponse> |
listPrivateConnectionsCallable()
Use this method to list private connectivity configurations in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListPrivateConnectionsRequest,DatastreamClient.ListPrivateConnectionsPagedResponse> |
listPrivateConnectionsPagedCallable()
Use this method to list private connectivity configurations in a project and location.
|
DatastreamClient.ListRoutesPagedResponse |
listRoutes(ListRoutesRequest request)
Use this method to list routes created for a private connectivity in a project and location.
|
DatastreamClient.ListRoutesPagedResponse |
listRoutes(PrivateConnectionName parent)
Use this method to list routes created for a private connectivity in a project and location.
|
DatastreamClient.ListRoutesPagedResponse |
listRoutes(String parent)
Use this method to list routes created for a private connectivity in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListRoutesRequest,ListRoutesResponse> |
listRoutesCallable()
Use this method to list routes created for a private connectivity in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListRoutesRequest,DatastreamClient.ListRoutesPagedResponse> |
listRoutesPagedCallable()
Use this method to list routes created for a private connectivity in a project and location.
|
DatastreamClient.ListStreamsPagedResponse |
listStreams(ListStreamsRequest request)
Use this method to list streams in a project and location.
|
DatastreamClient.ListStreamsPagedResponse |
listStreams(LocationName parent)
Use this method to list streams in a project and location.
|
DatastreamClient.ListStreamsPagedResponse |
listStreams(String parent)
Use this method to list streams in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListStreamsRequest,ListStreamsResponse> |
listStreamsCallable()
Use this method to list streams in a project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListStreamsRequest,DatastreamClient.ListStreamsPagedResponse> |
listStreamsPagedCallable()
Use this method to list streams in a project and location.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> |
updateConnectionProfileAsync(ConnectionProfile connectionProfile,
com.google.protobuf.FieldMask updateMask)
Use this method to update the parameters of a connection profile.
|
com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> |
updateConnectionProfileAsync(UpdateConnectionProfileRequest request)
Use this method to update the parameters of a connection profile.
|
com.google.api.gax.rpc.UnaryCallable<UpdateConnectionProfileRequest,com.google.longrunning.Operation> |
updateConnectionProfileCallable()
Use this method to update the parameters of a connection profile.
|
com.google.api.gax.rpc.OperationCallable<UpdateConnectionProfileRequest,ConnectionProfile,OperationMetadata> |
updateConnectionProfileOperationCallable()
Use this method to update the parameters of a connection profile.
|
com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> |
updateStreamAsync(Stream stream,
com.google.protobuf.FieldMask updateMask)
Use this method to update the configuration of a stream.
|
com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> |
updateStreamAsync(UpdateStreamRequest request)
Use this method to update the configuration of a stream.
|
com.google.api.gax.rpc.UnaryCallable<UpdateStreamRequest,com.google.longrunning.Operation> |
updateStreamCallable()
Use this method to update the configuration of a stream.
|
com.google.api.gax.rpc.OperationCallable<UpdateStreamRequest,Stream,OperationMetadata> |
updateStreamOperationCallable()
Use this method to update the configuration of a stream.
|
protected DatastreamClient(DatastreamSettings settings) throws IOException
IOExceptionprotected DatastreamClient(DatastreamStub stub)
public static final DatastreamClient create() throws IOException
IOExceptionpublic static final DatastreamClient create(DatastreamSettings settings) throws IOException
IOExceptionpublic static final DatastreamClient create(DatastreamStub stub)
public final DatastreamSettings getSettings()
public DatastreamStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final DatastreamClient.ListConnectionProfilesPagedResponse listConnectionProfiles(LocationName parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (ConnectionProfile element :
datastreamClient.listConnectionProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of connection profiles.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListConnectionProfilesPagedResponse listConnectionProfiles(String parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (ConnectionProfile element :
datastreamClient.listConnectionProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of connection profiles.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListConnectionProfilesPagedResponse listConnectionProfiles(ListConnectionProfilesRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListConnectionProfilesRequest request =
ListConnectionProfilesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (ConnectionProfile element :
datastreamClient.listConnectionProfiles(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListConnectionProfilesRequest,DatastreamClient.ListConnectionProfilesPagedResponse> listConnectionProfilesPagedCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListConnectionProfilesRequest request =
ListConnectionProfilesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<ConnectionProfile> future =
datastreamClient.listConnectionProfilesPagedCallable().futureCall(request);
// Do something.
for (ConnectionProfile element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListConnectionProfilesRequest,ListConnectionProfilesResponse> listConnectionProfilesCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListConnectionProfilesRequest request =
ListConnectionProfilesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListConnectionProfilesResponse response =
datastreamClient.listConnectionProfilesCallable().call(request);
for (ConnectionProfile element : response.getConnectionProfilesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ConnectionProfile getConnectionProfile(ConnectionProfileName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ConnectionProfileName name =
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]");
ConnectionProfile response = datastreamClient.getConnectionProfile(name);
}
name - Required. The name of the connection profile resource to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConnectionProfile getConnectionProfile(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name =
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]").toString();
ConnectionProfile response = datastreamClient.getConnectionProfile(name);
}
name - Required. The name of the connection profile resource to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ConnectionProfile getConnectionProfile(GetConnectionProfileRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetConnectionProfileRequest request =
GetConnectionProfileRequest.newBuilder()
.setName(
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
.toString())
.build();
ConnectionProfile response = datastreamClient.getConnectionProfile(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetConnectionProfileRequest,ConnectionProfile> getConnectionProfileCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetConnectionProfileRequest request =
GetConnectionProfileRequest.newBuilder()
.setName(
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
.toString())
.build();
ApiFuture<ConnectionProfile> future =
datastreamClient.getConnectionProfileCallable().futureCall(request);
// Do something.
ConnectionProfile response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(LocationName parent, ConnectionProfile connectionProfile, String connectionProfileId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build();
String connectionProfileId = "connectionProfileId597575526";
ConnectionProfile response =
datastreamClient
.createConnectionProfileAsync(parent, connectionProfile, connectionProfileId)
.get();
}
parent - Required. The parent that owns the collection of ConnectionProfiles.connectionProfile - Required. The connection profile resource to create.connectionProfileId - Required. The connection profile identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(String parent, ConnectionProfile connectionProfile, String connectionProfileId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build();
String connectionProfileId = "connectionProfileId597575526";
ConnectionProfile response =
datastreamClient
.createConnectionProfileAsync(parent, connectionProfile, connectionProfileId)
.get();
}
parent - Required. The parent that owns the collection of ConnectionProfiles.connectionProfile - Required. The connection profile resource to create.connectionProfileId - Required. The connection profile identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> createConnectionProfileAsync(CreateConnectionProfileRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateConnectionProfileRequest request =
CreateConnectionProfileRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setConnectionProfileId("connectionProfileId597575526")
.setConnectionProfile(ConnectionProfile.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ConnectionProfile response = datastreamClient.createConnectionProfileAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateConnectionProfileRequest,ConnectionProfile,OperationMetadata> createConnectionProfileOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateConnectionProfileRequest request =
CreateConnectionProfileRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setConnectionProfileId("connectionProfileId597575526")
.setConnectionProfile(ConnectionProfile.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<ConnectionProfile, OperationMetadata> future =
datastreamClient.createConnectionProfileOperationCallable().futureCall(request);
// Do something.
ConnectionProfile response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateConnectionProfileRequest,com.google.longrunning.Operation> createConnectionProfileCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateConnectionProfileRequest request =
CreateConnectionProfileRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setConnectionProfileId("connectionProfileId597575526")
.setConnectionProfile(ConnectionProfile.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
datastreamClient.createConnectionProfileCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> updateConnectionProfileAsync(ConnectionProfile connectionProfile, com.google.protobuf.FieldMask updateMask)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ConnectionProfile connectionProfile = ConnectionProfile.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ConnectionProfile response =
datastreamClient.updateConnectionProfileAsync(connectionProfile, updateMask).get();
}
connectionProfile - Required. The ConnectionProfile to update.updateMask - Optional. Field mask is used to specify the fields to be overwritten in the
ConnectionProfile 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ConnectionProfile,OperationMetadata> updateConnectionProfileAsync(UpdateConnectionProfileRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
UpdateConnectionProfileRequest request =
UpdateConnectionProfileRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setConnectionProfile(ConnectionProfile.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ConnectionProfile response = datastreamClient.updateConnectionProfileAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateConnectionProfileRequest,ConnectionProfile,OperationMetadata> updateConnectionProfileOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
UpdateConnectionProfileRequest request =
UpdateConnectionProfileRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setConnectionProfile(ConnectionProfile.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<ConnectionProfile, OperationMetadata> future =
datastreamClient.updateConnectionProfileOperationCallable().futureCall(request);
// Do something.
ConnectionProfile response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateConnectionProfileRequest,com.google.longrunning.Operation> updateConnectionProfileCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
UpdateConnectionProfileRequest request =
UpdateConnectionProfileRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setConnectionProfile(ConnectionProfile.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
datastreamClient.updateConnectionProfileCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileAsync(ConnectionProfileName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ConnectionProfileName name =
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]");
datastreamClient.deleteConnectionProfileAsync(name).get();
}
name - Required. The name of the connection profile resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileAsync(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name =
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]").toString();
datastreamClient.deleteConnectionProfileAsync(name).get();
}
name - Required. The name of the connection profile resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileAsync(DeleteConnectionProfileRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteConnectionProfileRequest request =
DeleteConnectionProfileRequest.newBuilder()
.setName(
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
.toString())
.setRequestId("requestId693933066")
.build();
datastreamClient.deleteConnectionProfileAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteConnectionProfileRequest,com.google.protobuf.Empty,OperationMetadata> deleteConnectionProfileOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteConnectionProfileRequest request =
DeleteConnectionProfileRequest.newBuilder()
.setName(
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
datastreamClient.deleteConnectionProfileOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteConnectionProfileRequest,com.google.longrunning.Operation> deleteConnectionProfileCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteConnectionProfileRequest request =
DeleteConnectionProfileRequest.newBuilder()
.setName(
ConnectionProfileName.of("[PROJECT]", "[LOCATION]", "[CONNECTION_PROFILE]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
datastreamClient.deleteConnectionProfileCallable().futureCall(request);
// Do something.
future.get();
}
public final DiscoverConnectionProfileResponse discoverConnectionProfile(DiscoverConnectionProfileRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DiscoverConnectionProfileRequest request =
DiscoverConnectionProfileRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
DiscoverConnectionProfileResponse response =
datastreamClient.discoverConnectionProfile(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DiscoverConnectionProfileRequest,DiscoverConnectionProfileResponse> discoverConnectionProfileCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DiscoverConnectionProfileRequest request =
DiscoverConnectionProfileRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<DiscoverConnectionProfileResponse> future =
datastreamClient.discoverConnectionProfileCallable().futureCall(request);
// Do something.
DiscoverConnectionProfileResponse response = future.get();
}
public final DatastreamClient.ListStreamsPagedResponse listStreams(LocationName parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Stream element : datastreamClient.listStreams(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of streams.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListStreamsPagedResponse listStreams(String parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Stream element : datastreamClient.listStreams(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of streams.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListStreamsPagedResponse listStreams(ListStreamsRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListStreamsRequest request =
ListStreamsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Stream element : datastreamClient.listStreams(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListStreamsRequest,DatastreamClient.ListStreamsPagedResponse> listStreamsPagedCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListStreamsRequest request =
ListStreamsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Stream> future = datastreamClient.listStreamsPagedCallable().futureCall(request);
// Do something.
for (Stream element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListStreamsRequest,ListStreamsResponse> listStreamsCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListStreamsRequest request =
ListStreamsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListStreamsResponse response = datastreamClient.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 Stream getStream(StreamName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
StreamName name = StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]");
Stream response = datastreamClient.getStream(name);
}
name - Required. The name of the stream resource to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Stream getStream(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name = StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString();
Stream response = datastreamClient.getStream(name);
}
name - Required. The name of the stream resource to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Stream getStream(GetStreamRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetStreamRequest request =
GetStreamRequest.newBuilder()
.setName(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.build();
Stream response = datastreamClient.getStream(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetStreamRequest,Stream> getStreamCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetStreamRequest request =
GetStreamRequest.newBuilder()
.setName(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.build();
ApiFuture<Stream> future = datastreamClient.getStreamCallable().futureCall(request);
// Do something.
Stream response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> createStreamAsync(LocationName parent, Stream stream, String streamId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Stream stream = Stream.newBuilder().build();
String streamId = "streamId1790933179";
Stream response = datastreamClient.createStreamAsync(parent, stream, streamId).get();
}
parent - Required. The parent that owns the collection of streams.stream - Required. The stream resource to create.streamId - Required. The stream identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> createStreamAsync(String parent, Stream stream, String streamId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Stream stream = Stream.newBuilder().build();
String streamId = "streamId1790933179";
Stream response = datastreamClient.createStreamAsync(parent, stream, streamId).get();
}
parent - Required. The parent that owns the collection of streams.stream - Required. The stream resource to create.streamId - Required. The stream identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> createStreamAsync(CreateStreamRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateStreamRequest request =
CreateStreamRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setStreamId("streamId1790933179")
.setStream(Stream.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setForce(true)
.build();
Stream response = datastreamClient.createStreamAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateStreamRequest,Stream,OperationMetadata> createStreamOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateStreamRequest request =
CreateStreamRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setStreamId("streamId1790933179")
.setStream(Stream.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setForce(true)
.build();
OperationFuture<Stream, OperationMetadata> future =
datastreamClient.createStreamOperationCallable().futureCall(request);
// Do something.
Stream response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateStreamRequest,com.google.longrunning.Operation> createStreamCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateStreamRequest request =
CreateStreamRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setStreamId("streamId1790933179")
.setStream(Stream.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setForce(true)
.build();
ApiFuture<Operation> future = datastreamClient.createStreamCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> updateStreamAsync(Stream stream, com.google.protobuf.FieldMask updateMask)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
Stream stream = Stream.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Stream response = datastreamClient.updateStreamAsync(stream, updateMask).get();
}
stream - Required. The stream resource to update.updateMask - Optional. 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Stream,OperationMetadata> updateStreamAsync(UpdateStreamRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
UpdateStreamRequest request =
UpdateStreamRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setStream(Stream.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setForce(true)
.build();
Stream response = datastreamClient.updateStreamAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateStreamRequest,Stream,OperationMetadata> updateStreamOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
UpdateStreamRequest request =
UpdateStreamRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setStream(Stream.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setForce(true)
.build();
OperationFuture<Stream, OperationMetadata> future =
datastreamClient.updateStreamOperationCallable().futureCall(request);
// Do something.
Stream response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateStreamRequest,com.google.longrunning.Operation> updateStreamCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
UpdateStreamRequest request =
UpdateStreamRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setStream(Stream.newBuilder().build())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setForce(true)
.build();
ApiFuture<Operation> future = datastreamClient.updateStreamCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteStreamAsync(StreamName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
StreamName name = StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]");
datastreamClient.deleteStreamAsync(name).get();
}
name - Required. The name of the stream resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteStreamAsync(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name = StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString();
datastreamClient.deleteStreamAsync(name).get();
}
name - Required. The name of the stream resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteStreamAsync(DeleteStreamRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteStreamRequest request =
DeleteStreamRequest.newBuilder()
.setName(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.setRequestId("requestId693933066")
.build();
datastreamClient.deleteStreamAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteStreamRequest,com.google.protobuf.Empty,OperationMetadata> deleteStreamOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteStreamRequest request =
DeleteStreamRequest.newBuilder()
.setName(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
datastreamClient.deleteStreamOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteStreamRequest,com.google.longrunning.Operation> deleteStreamCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteStreamRequest request =
DeleteStreamRequest.newBuilder()
.setName(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = datastreamClient.deleteStreamCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<FetchErrorsResponse,OperationMetadata> fetchErrorsAsync(FetchErrorsRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
FetchErrorsRequest request =
FetchErrorsRequest.newBuilder()
.setStream(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.build();
FetchErrorsResponse response = datastreamClient.fetchErrorsAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<FetchErrorsRequest,FetchErrorsResponse,OperationMetadata> fetchErrorsOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
FetchErrorsRequest request =
FetchErrorsRequest.newBuilder()
.setStream(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.build();
OperationFuture<FetchErrorsResponse, OperationMetadata> future =
datastreamClient.fetchErrorsOperationCallable().futureCall(request);
// Do something.
FetchErrorsResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<FetchErrorsRequest,com.google.longrunning.Operation> fetchErrorsCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
FetchErrorsRequest request =
FetchErrorsRequest.newBuilder()
.setStream(StreamName.of("[PROJECT]", "[LOCATION]", "[STREAM]").toString())
.build();
ApiFuture<Operation> future = datastreamClient.fetchErrorsCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final DatastreamClient.FetchStaticIpsPagedResponse fetchStaticIps(LocationName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
for (String element : datastreamClient.fetchStaticIps(name).iterateAll()) {
// doThingsWith(element);
}
}
name - Required. The name resource of the Response type. Must be in the format
`projects/*/locations/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.FetchStaticIpsPagedResponse fetchStaticIps(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (String element : datastreamClient.fetchStaticIps(name).iterateAll()) {
// doThingsWith(element);
}
}
name - Required. The name resource of the Response type. Must be in the format
`projects/*/locations/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.FetchStaticIpsPagedResponse fetchStaticIps(FetchStaticIpsRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
FetchStaticIpsRequest request =
FetchStaticIpsRequest.newBuilder()
.setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (String element : datastreamClient.fetchStaticIps(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<FetchStaticIpsRequest,DatastreamClient.FetchStaticIpsPagedResponse> fetchStaticIpsPagedCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
FetchStaticIpsRequest request =
FetchStaticIpsRequest.newBuilder()
.setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<String> future = datastreamClient.fetchStaticIpsPagedCallable().futureCall(request);
// Do something.
for (String element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<FetchStaticIpsRequest,FetchStaticIpsResponse> fetchStaticIpsCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
FetchStaticIpsRequest request =
FetchStaticIpsRequest.newBuilder()
.setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
FetchStaticIpsResponse response = datastreamClient.fetchStaticIpsCallable().call(request);
for (String element : response.getStaticIpsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<PrivateConnection,OperationMetadata> createPrivateConnectionAsync(LocationName parent, PrivateConnection privateConnection, String privateConnectionId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
PrivateConnection privateConnection = PrivateConnection.newBuilder().build();
String privateConnectionId = "privateConnectionId-1926654532";
PrivateConnection response =
datastreamClient
.createPrivateConnectionAsync(parent, privateConnection, privateConnectionId)
.get();
}
parent - Required. The parent that owns the collection of PrivateConnections.privateConnection - Required. The Private Connectivity resource to create.privateConnectionId - Required. The private connectivity identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<PrivateConnection,OperationMetadata> createPrivateConnectionAsync(String parent, PrivateConnection privateConnection, String privateConnectionId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
PrivateConnection privateConnection = PrivateConnection.newBuilder().build();
String privateConnectionId = "privateConnectionId-1926654532";
PrivateConnection response =
datastreamClient
.createPrivateConnectionAsync(parent, privateConnection, privateConnectionId)
.get();
}
parent - Required. The parent that owns the collection of PrivateConnections.privateConnection - Required. The Private Connectivity resource to create.privateConnectionId - Required. The private connectivity identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<PrivateConnection,OperationMetadata> createPrivateConnectionAsync(CreatePrivateConnectionRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreatePrivateConnectionRequest request =
CreatePrivateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPrivateConnectionId("privateConnectionId-1926654532")
.setPrivateConnection(PrivateConnection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
PrivateConnection response = datastreamClient.createPrivateConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreatePrivateConnectionRequest,PrivateConnection,OperationMetadata> createPrivateConnectionOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreatePrivateConnectionRequest request =
CreatePrivateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPrivateConnectionId("privateConnectionId-1926654532")
.setPrivateConnection(PrivateConnection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<PrivateConnection, OperationMetadata> future =
datastreamClient.createPrivateConnectionOperationCallable().futureCall(request);
// Do something.
PrivateConnection response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreatePrivateConnectionRequest,com.google.longrunning.Operation> createPrivateConnectionCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreatePrivateConnectionRequest request =
CreatePrivateConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPrivateConnectionId("privateConnectionId-1926654532")
.setPrivateConnection(PrivateConnection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
datastreamClient.createPrivateConnectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final PrivateConnection getPrivateConnection(PrivateConnectionName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
PrivateConnectionName name =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]");
PrivateConnection response = datastreamClient.getPrivateConnection(name);
}
name - Required. The name of the private connectivity configuration to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PrivateConnection getPrivateConnection(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]").toString();
PrivateConnection response = datastreamClient.getPrivateConnection(name);
}
name - Required. The name of the private connectivity configuration to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PrivateConnection getPrivateConnection(GetPrivateConnectionRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetPrivateConnectionRequest request =
GetPrivateConnectionRequest.newBuilder()
.setName(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.build();
PrivateConnection response = datastreamClient.getPrivateConnection(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetPrivateConnectionRequest,PrivateConnection> getPrivateConnectionCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetPrivateConnectionRequest request =
GetPrivateConnectionRequest.newBuilder()
.setName(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.build();
ApiFuture<PrivateConnection> future =
datastreamClient.getPrivateConnectionCallable().futureCall(request);
// Do something.
PrivateConnection response = future.get();
}
public final DatastreamClient.ListPrivateConnectionsPagedResponse listPrivateConnections(LocationName parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (PrivateConnection element :
datastreamClient.listPrivateConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of private connectivity
configurations.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListPrivateConnectionsPagedResponse listPrivateConnections(String parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (PrivateConnection element :
datastreamClient.listPrivateConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of private connectivity
configurations.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListPrivateConnectionsPagedResponse listPrivateConnections(ListPrivateConnectionsRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListPrivateConnectionsRequest request =
ListPrivateConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (PrivateConnection element :
datastreamClient.listPrivateConnections(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListPrivateConnectionsRequest,DatastreamClient.ListPrivateConnectionsPagedResponse> listPrivateConnectionsPagedCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListPrivateConnectionsRequest request =
ListPrivateConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<PrivateConnection> future =
datastreamClient.listPrivateConnectionsPagedCallable().futureCall(request);
// Do something.
for (PrivateConnection element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListPrivateConnectionsRequest,ListPrivateConnectionsResponse> listPrivateConnectionsCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListPrivateConnectionsRequest request =
ListPrivateConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListPrivateConnectionsResponse response =
datastreamClient.listPrivateConnectionsCallable().call(request);
for (PrivateConnection element : response.getPrivateConnectionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionAsync(PrivateConnectionName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
PrivateConnectionName name =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]");
datastreamClient.deletePrivateConnectionAsync(name).get();
}
name - Required. The name of the private connectivity configuration to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionAsync(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]").toString();
datastreamClient.deletePrivateConnectionAsync(name).get();
}
name - Required. The name of the private connectivity configuration to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionAsync(DeletePrivateConnectionRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeletePrivateConnectionRequest request =
DeletePrivateConnectionRequest.newBuilder()
.setName(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setRequestId("requestId693933066")
.setForce(true)
.build();
datastreamClient.deletePrivateConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeletePrivateConnectionRequest,com.google.protobuf.Empty,OperationMetadata> deletePrivateConnectionOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeletePrivateConnectionRequest request =
DeletePrivateConnectionRequest.newBuilder()
.setName(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setRequestId("requestId693933066")
.setForce(true)
.build();
OperationFuture<Empty, OperationMetadata> future =
datastreamClient.deletePrivateConnectionOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeletePrivateConnectionRequest,com.google.longrunning.Operation> deletePrivateConnectionCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeletePrivateConnectionRequest request =
DeletePrivateConnectionRequest.newBuilder()
.setName(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setRequestId("requestId693933066")
.setForce(true)
.build();
ApiFuture<Operation> future =
datastreamClient.deletePrivateConnectionCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Route,OperationMetadata> createRouteAsync(PrivateConnectionName parent, Route route, String routeId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
PrivateConnectionName parent =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]");
Route route = Route.newBuilder().build();
String routeId = "routeId1385647428";
Route response = datastreamClient.createRouteAsync(parent, route, routeId).get();
}
parent - Required. The parent that owns the collection of Routes.route - Required. The Route resource to create.routeId - Required. The Route identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Route,OperationMetadata> createRouteAsync(String parent, Route route, String routeId)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]").toString();
Route route = Route.newBuilder().build();
String routeId = "routeId1385647428";
Route response = datastreamClient.createRouteAsync(parent, route, routeId).get();
}
parent - Required. The parent that owns the collection of Routes.route - Required. The Route resource to create.routeId - Required. The Route identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Route,OperationMetadata> createRouteAsync(CreateRouteRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateRouteRequest request =
CreateRouteRequest.newBuilder()
.setParent(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setRouteId("routeId1385647428")
.setRoute(Route.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Route response = datastreamClient.createRouteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateRouteRequest,Route,OperationMetadata> createRouteOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateRouteRequest request =
CreateRouteRequest.newBuilder()
.setParent(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setRouteId("routeId1385647428")
.setRoute(Route.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Route, OperationMetadata> future =
datastreamClient.createRouteOperationCallable().futureCall(request);
// Do something.
Route response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateRouteRequest,com.google.longrunning.Operation> createRouteCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
CreateRouteRequest request =
CreateRouteRequest.newBuilder()
.setParent(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setRouteId("routeId1385647428")
.setRoute(Route.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = datastreamClient.createRouteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Route getRoute(RouteName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
RouteName name = RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]");
Route response = datastreamClient.getRoute(name);
}
name - Required. The name of the Route resource to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Route getRoute(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name =
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]").toString();
Route response = datastreamClient.getRoute(name);
}
name - Required. The name of the Route resource to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Route getRoute(GetRouteRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetRouteRequest request =
GetRouteRequest.newBuilder()
.setName(
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]")
.toString())
.build();
Route response = datastreamClient.getRoute(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRouteRequest,Route> getRouteCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
GetRouteRequest request =
GetRouteRequest.newBuilder()
.setName(
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]")
.toString())
.build();
ApiFuture<Route> future = datastreamClient.getRouteCallable().futureCall(request);
// Do something.
Route response = future.get();
}
public final DatastreamClient.ListRoutesPagedResponse listRoutes(PrivateConnectionName parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
PrivateConnectionName parent =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]");
for (Route element : datastreamClient.listRoutes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of Routess.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListRoutesPagedResponse listRoutes(String parent)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String parent =
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]").toString();
for (Route element : datastreamClient.listRoutes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent that owns the collection of Routess.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DatastreamClient.ListRoutesPagedResponse listRoutes(ListRoutesRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListRoutesRequest request =
ListRoutesRequest.newBuilder()
.setParent(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Route element : datastreamClient.listRoutes(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRoutesRequest,DatastreamClient.ListRoutesPagedResponse> listRoutesPagedCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListRoutesRequest request =
ListRoutesRequest.newBuilder()
.setParent(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Route> future = datastreamClient.listRoutesPagedCallable().futureCall(request);
// Do something.
for (Route element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRoutesRequest,ListRoutesResponse> listRoutesCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
ListRoutesRequest request =
ListRoutesRequest.newBuilder()
.setParent(
PrivateConnectionName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListRoutesResponse response = datastreamClient.listRoutesCallable().call(request);
for (Route element : response.getRoutesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRouteAsync(RouteName name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
RouteName name = RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]");
datastreamClient.deleteRouteAsync(name).get();
}
name - Required. The name of the Route resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRouteAsync(String name)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
String name =
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]").toString();
datastreamClient.deleteRouteAsync(name).get();
}
name - Required. The name of the Route resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteRouteAsync(DeleteRouteRequest request)
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteRouteRequest request =
DeleteRouteRequest.newBuilder()
.setName(
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]")
.toString())
.setRequestId("requestId693933066")
.build();
datastreamClient.deleteRouteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRouteRequest,com.google.protobuf.Empty,OperationMetadata> deleteRouteOperationCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteRouteRequest request =
DeleteRouteRequest.newBuilder()
.setName(
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
datastreamClient.deleteRouteOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRouteRequest,com.google.longrunning.Operation> deleteRouteCallable()
Sample 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 (DatastreamClient datastreamClient = DatastreamClient.create()) {
DeleteRouteRequest request =
DeleteRouteRequest.newBuilder()
.setName(
RouteName.of("[PROJECT]", "[LOCATION]", "[PRIVATE_CONNECTION]", "[ROUTE]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = datastreamClient.deleteRouteCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2022 Google LLC. All rights reserved.