Class TransportManagerClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) {
RemoteTransportProfileName name =
RemoteTransportProfileName.of("[PROJECT]", "[LOCATION]", "[REMOTE_TRANSPORT_PROFILE]");
RemoteTransportProfile response = transportManagerClient.getRemoteTransportProfile(name);
}
Note: close() needs to be called on the TransportManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListRemoteTransportProfiles |
Lists RemoteTransportProfiles in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRemoteTransportProfile |
Gets details of a single RemoteTransportProfile. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListTransports |
Lists Transports in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetTransport |
Gets details of a single Transport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetStatus |
Gets the operational status of a single Transport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateTransport |
Creates a new Transport in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateTransport |
Updates the parameters of a single Transport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteTransport |
Deletes a single Transport. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service.This method can be called in two ways: * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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 TransportManagerSettings 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
TransportManagerSettings transportManagerSettings =
TransportManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TransportManagerClient transportManagerClient =
TransportManagerClient.create(transportManagerSettings);
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
TransportManagerSettings transportManagerSettings =
TransportManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
TransportManagerClient transportManagerClient =
TransportManagerClient.create(transportManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedConstructs an instance of TransportManagerClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final TransportManagerClientcreate()Constructs an instance of TransportManagerClient with default settings.static final TransportManagerClientcreate(TransportManagerStub stub) Constructs an instance of TransportManagerClient, using the given stub for making calls.static final TransportManagerClientcreate(TransportManagerSettings settings) Constructs an instance of TransportManagerClient, using the given settings.Creates a new Transport in a given project and location.createTransportAsync(LocationName parent, Transport transport, String transportId) Creates a new Transport in a given project and location.createTransportAsync(String parent, Transport transport, String transportId) Creates a new Transport in a given project and location.Creates a new Transport in a given project and location.Creates a new Transport in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Transport.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Transport.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTransportAsync(String name) Deletes a single Transport.Deletes a single Transport.final OperationCallable<DeleteTransportRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Transport.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final RemoteTransportProfileGets details of a single RemoteTransportProfile.final RemoteTransportProfileGets details of a single RemoteTransportProfile.final RemoteTransportProfileGets details of a single RemoteTransportProfile.Gets details of a single RemoteTransportProfile.final TransportManagerSettingsfinal GetStatusResponsegetStatus(GetStatusRequest request) Gets the operational status of a single Transport.final GetStatusResponsegetStatus(TransportName name) Gets the operational status of a single Transport.final GetStatusResponseGets the operational status of a single Transport.Gets the operational status of a single Transport.getStub()final TransportgetTransport(GetTransportRequest request) Gets details of a single Transport.final TransportgetTransport(TransportName name) Gets details of a single Transport.final TransportgetTransport(String name) Gets details of a single Transport.Gets details of a single Transport.booleanbooleanlistLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method can be called in two ways:Lists information about the supported locations for this service.This method can be called in two ways:Lists information about the supported locations for this service.This method can be called in two ways:Lists RemoteTransportProfiles in a given project and location.Lists RemoteTransportProfiles in a given project and location.listRemoteTransportProfiles(String parent) Lists RemoteTransportProfiles in a given project and location.Lists RemoteTransportProfiles in a given project and location.final UnaryCallable<ListRemoteTransportProfilesRequest,TransportManagerClient.ListRemoteTransportProfilesPagedResponse> Lists RemoteTransportProfiles in a given project and location.listTransports(ListTransportsRequest request) Lists Transports in a given project and location.listTransports(LocationName parent) Lists Transports in a given project and location.listTransports(String parent) Lists Transports in a given project and location.Lists Transports in a given project and location.Lists Transports in a given project and location.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.updateTransportAsync(Transport transport, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Transport.Updates the parameters of a single Transport.Updates the parameters of a single Transport.Updates the parameters of a single Transport.
-
Constructor Details
-
TransportManagerClient
Constructs an instance of TransportManagerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
TransportManagerClient
-
-
Method Details
-
create
Constructs an instance of TransportManagerClient with default settings.- Throws:
IOException
-
create
public static final TransportManagerClient create(TransportManagerSettings settings) throws IOException Constructs an instance of TransportManagerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of TransportManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(TransportManagerSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listRemoteTransportProfiles
public final TransportManagerClient.ListRemoteTransportProfilesPagedResponse listRemoteTransportProfiles(LocationName parent) Lists RemoteTransportProfiles in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (RemoteTransportProfile element : transportManagerClient.listRemoteTransportProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListRemoteTransportProfilesRequest.- Throws:
ApiException- if the remote call fails
-
listRemoteTransportProfiles
public final TransportManagerClient.ListRemoteTransportProfilesPagedResponse listRemoteTransportProfiles(String parent) Lists RemoteTransportProfiles in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (RemoteTransportProfile element : transportManagerClient.listRemoteTransportProfiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListRemoteTransportProfilesRequest.- Throws:
ApiException- if the remote call fails
-
listRemoteTransportProfiles
public final TransportManagerClient.ListRemoteTransportProfilesPagedResponse listRemoteTransportProfiles(ListRemoteTransportProfilesRequest request) Lists RemoteTransportProfiles in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListRemoteTransportProfilesRequest request = ListRemoteTransportProfilesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (RemoteTransportProfile element : transportManagerClient.listRemoteTransportProfiles(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRemoteTransportProfilesPagedCallable
public final UnaryCallable<ListRemoteTransportProfilesRequest,TransportManagerClient.ListRemoteTransportProfilesPagedResponse> listRemoteTransportProfilesPagedCallable()Lists RemoteTransportProfiles in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListRemoteTransportProfilesRequest request = ListRemoteTransportProfilesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<RemoteTransportProfile> future = transportManagerClient.listRemoteTransportProfilesPagedCallable().futureCall(request); // Do something. for (RemoteTransportProfile element : future.get().iterateAll()) { // doThingsWith(element); } } -
listRemoteTransportProfilesCallable
public final UnaryCallable<ListRemoteTransportProfilesRequest,ListRemoteTransportProfilesResponse> listRemoteTransportProfilesCallable()Lists RemoteTransportProfiles in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListRemoteTransportProfilesRequest request = ListRemoteTransportProfilesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListRemoteTransportProfilesResponse response = transportManagerClient.listRemoteTransportProfilesCallable().call(request); for (RemoteTransportProfile element : response.getRemoteTransportProfilesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getRemoteTransportProfile
Gets details of a single RemoteTransportProfile.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { RemoteTransportProfileName name = RemoteTransportProfileName.of("[PROJECT]", "[LOCATION]", "[REMOTE_TRANSPORT_PROFILE]"); RemoteTransportProfile response = transportManagerClient.getRemoteTransportProfile(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getRemoteTransportProfile
Gets details of a single RemoteTransportProfile.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String name = RemoteTransportProfileName.of("[PROJECT]", "[LOCATION]", "[REMOTE_TRANSPORT_PROFILE]") .toString(); RemoteTransportProfile response = transportManagerClient.getRemoteTransportProfile(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getRemoteTransportProfile
public final RemoteTransportProfile getRemoteTransportProfile(GetRemoteTransportProfileRequest request) Gets details of a single RemoteTransportProfile.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetRemoteTransportProfileRequest request = GetRemoteTransportProfileRequest.newBuilder() .setName( RemoteTransportProfileName.of( "[PROJECT]", "[LOCATION]", "[REMOTE_TRANSPORT_PROFILE]") .toString()) .build(); RemoteTransportProfile response = transportManagerClient.getRemoteTransportProfile(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRemoteTransportProfileCallable
public final UnaryCallable<GetRemoteTransportProfileRequest,RemoteTransportProfile> getRemoteTransportProfileCallable()Gets details of a single RemoteTransportProfile.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetRemoteTransportProfileRequest request = GetRemoteTransportProfileRequest.newBuilder() .setName( RemoteTransportProfileName.of( "[PROJECT]", "[LOCATION]", "[REMOTE_TRANSPORT_PROFILE]") .toString()) .build(); ApiFuture<RemoteTransportProfile> future = transportManagerClient.getRemoteTransportProfileCallable().futureCall(request); // Do something. RemoteTransportProfile response = future.get(); } -
listTransports
Lists Transports in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Transport element : transportManagerClient.listTransports(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListTransportsRequest.- Throws:
ApiException- if the remote call fails
-
listTransports
Lists Transports in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Transport element : transportManagerClient.listTransports(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListTransportsRequest.- Throws:
ApiException- if the remote call fails
-
listTransports
public final TransportManagerClient.ListTransportsPagedResponse listTransports(ListTransportsRequest request) Lists Transports in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListTransportsRequest request = ListTransportsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Transport element : transportManagerClient.listTransports(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listTransportsPagedCallable
public final UnaryCallable<ListTransportsRequest,TransportManagerClient.ListTransportsPagedResponse> listTransportsPagedCallable()Lists Transports in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListTransportsRequest request = ListTransportsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Transport> future = transportManagerClient.listTransportsPagedCallable().futureCall(request); // Do something. for (Transport element : future.get().iterateAll()) { // doThingsWith(element); } } -
listTransportsCallable
Lists Transports in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListTransportsRequest request = ListTransportsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListTransportsResponse response = transportManagerClient.listTransportsCallable().call(request); for (Transport element : response.getTransportsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getTransport
Gets details of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { TransportName name = TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]"); Transport response = transportManagerClient.getTransport(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getTransport
Gets details of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String name = TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString(); Transport response = transportManagerClient.getTransport(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getTransport
Gets details of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetTransportRequest request = GetTransportRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .build(); Transport response = transportManagerClient.getTransport(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getTransportCallable
Gets details of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetTransportRequest request = GetTransportRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .build(); ApiFuture<Transport> future = transportManagerClient.getTransportCallable().futureCall(request); // Do something. Transport response = future.get(); } -
getStatus
Gets the operational status of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { TransportName name = TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]"); GetStatusResponse response = transportManagerClient.getStatus(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getStatus
Gets the operational status of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String name = TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString(); GetStatusResponse response = transportManagerClient.getStatus(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getStatus
Gets the operational status of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetStatusRequest request = GetStatusRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .build(); GetStatusResponse response = transportManagerClient.getStatus(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getStatusCallable
Gets the operational status of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetStatusRequest request = GetStatusRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .build(); ApiFuture<GetStatusResponse> future = transportManagerClient.getStatusCallable().futureCall(request); // Do something. GetStatusResponse response = future.get(); } -
createTransportAsync
public final OperationFuture<Transport,OperationMetadata> createTransportAsync(LocationName parent, Transport transport, String transportId) Creates a new Transport in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Transport transport = Transport.newBuilder().build(); String transportId = "transportId-1713251804"; Transport response = transportManagerClient.createTransportAsync(parent, transport, transportId).get(); }- Parameters:
parent- Required. Value for parent.transport- Required. The resource being createdtransportId- Required. Id of the requesting object- Throws:
ApiException- if the remote call fails
-
createTransportAsync
public final OperationFuture<Transport,OperationMetadata> createTransportAsync(String parent, Transport transport, String transportId) Creates a new Transport in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Transport transport = Transport.newBuilder().build(); String transportId = "transportId-1713251804"; Transport response = transportManagerClient.createTransportAsync(parent, transport, transportId).get(); }- Parameters:
parent- Required. Value for parent.transport- Required. The resource being createdtransportId- Required. Id of the requesting object- Throws:
ApiException- if the remote call fails
-
createTransportAsync
public final OperationFuture<Transport,OperationMetadata> createTransportAsync(CreateTransportRequest request) Creates a new Transport in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { CreateTransportRequest request = CreateTransportRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTransportId("transportId-1713251804") .setTransport(Transport.newBuilder().build()) .setRequestId("requestId693933066") .build(); Transport response = transportManagerClient.createTransportAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createTransportOperationCallable
public final OperationCallable<CreateTransportRequest,Transport, createTransportOperationCallable()OperationMetadata> Creates a new Transport in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { CreateTransportRequest request = CreateTransportRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTransportId("transportId-1713251804") .setTransport(Transport.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Transport, OperationMetadata> future = transportManagerClient.createTransportOperationCallable().futureCall(request); // Do something. Transport response = future.get(); } -
createTransportCallable
Creates a new Transport in a given project and location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { CreateTransportRequest request = CreateTransportRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setTransportId("transportId-1713251804") .setTransport(Transport.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = transportManagerClient.createTransportCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateTransportAsync
public final OperationFuture<Transport,OperationMetadata> updateTransportAsync(Transport transport, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { Transport transport = Transport.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Transport response = transportManagerClient.updateTransportAsync(transport, updateMask).get(); }- Parameters:
transport- Required. The resource being updated.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the Transport 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 present in the request will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateTransportAsync
public final OperationFuture<Transport,OperationMetadata> updateTransportAsync(UpdateTransportRequest request) Updates the parameters of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { UpdateTransportRequest request = UpdateTransportRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setTransport(Transport.newBuilder().build()) .setRequestId("requestId693933066") .build(); Transport response = transportManagerClient.updateTransportAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateTransportOperationCallable
public final OperationCallable<UpdateTransportRequest,Transport, updateTransportOperationCallable()OperationMetadata> Updates the parameters of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { UpdateTransportRequest request = UpdateTransportRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setTransport(Transport.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Transport, OperationMetadata> future = transportManagerClient.updateTransportOperationCallable().futureCall(request); // Do something. Transport response = future.get(); } -
updateTransportCallable
Updates the parameters of a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { UpdateTransportRequest request = UpdateTransportRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setTransport(Transport.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = transportManagerClient.updateTransportCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteTransportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTransportAsync(TransportName name) Deletes a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { TransportName name = TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]"); transportManagerClient.deleteTransportAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteTransportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTransportAsync(String name) Deletes a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { String name = TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString(); transportManagerClient.deleteTransportAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteTransportAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteTransportAsync(DeleteTransportRequest request) Deletes a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { DeleteTransportRequest request = DeleteTransportRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .setRequestId("requestId693933066") .build(); transportManagerClient.deleteTransportAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteTransportOperationCallable
public final OperationCallable<DeleteTransportRequest,com.google.protobuf.Empty, deleteTransportOperationCallable()OperationMetadata> Deletes a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { DeleteTransportRequest request = DeleteTransportRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = transportManagerClient.deleteTransportOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteTransportCallable
Deletes a single Transport.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { DeleteTransportRequest request = DeleteTransportRequest.newBuilder() .setName(TransportName.of("[PROJECT]", "[LOCATION]", "[TRANSPORT]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = transportManagerClient.deleteTransportCallable().futureCall(request); // Do something. future.get(); } -
listLocations
public final TransportManagerClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : transportManagerClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,TransportManagerClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = transportManagerClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = transportManagerClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = transportManagerClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = transportManagerClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = transportManagerClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = transportManagerClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = transportManagerClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = transportManagerClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = transportManagerClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (TransportManagerClient transportManagerClient = TransportManagerClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = transportManagerClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-