@Generated(value="by gapic-generator-java") public class GlobalOrganizationOperationsClient 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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
String operation = "operation1662702951";
DeleteGlobalOrganizationOperationResponse response =
globalOrganizationOperationsClient.delete(operation);
}
Note: close() needs to be called on the GlobalOrganizationOperationsClient 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 |
|---|---|---|
Delete |
Deletes the specified Operations resource. |
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.
|
Get |
Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. |
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.
|
List |
Retrieves a list of Operation resources contained within the specified organization. |
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.
|
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 GlobalOrganizationOperationsSettings 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
GlobalOrganizationOperationsSettings globalOrganizationOperationsSettings =
GlobalOrganizationOperationsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create(globalOrganizationOperationsSettings);
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
GlobalOrganizationOperationsSettings globalOrganizationOperationsSettings =
GlobalOrganizationOperationsSettings.newBuilder().setEndpoint(myEndpoint).build();
GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create(globalOrganizationOperationsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
GlobalOrganizationOperationsClient.ListFixedSizeCollection |
static class |
GlobalOrganizationOperationsClient.ListPage |
static class |
GlobalOrganizationOperationsClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
GlobalOrganizationOperationsClient(GlobalOrganizationOperationsSettings settings)
Constructs an instance of GlobalOrganizationOperationsClient, using the given settings.
|
protected |
GlobalOrganizationOperationsClient(GlobalOrganizationOperationsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static GlobalOrganizationOperationsClient |
create()
Constructs an instance of GlobalOrganizationOperationsClient with default settings.
|
static GlobalOrganizationOperationsClient |
create(GlobalOrganizationOperationsSettings settings)
Constructs an instance of GlobalOrganizationOperationsClient, using the given settings.
|
static GlobalOrganizationOperationsClient |
create(GlobalOrganizationOperationsStub stub)
Constructs an instance of GlobalOrganizationOperationsClient, using the given stub for making
calls.
|
DeleteGlobalOrganizationOperationResponse |
delete(DeleteGlobalOrganizationOperationRequest request)
Deletes the specified Operations resource.
|
DeleteGlobalOrganizationOperationResponse |
delete(String operation)
Deletes the specified Operations resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteGlobalOrganizationOperationRequest,DeleteGlobalOrganizationOperationResponse> |
deleteCallable()
Deletes the specified Operations resource.
|
Operation |
get(GetGlobalOrganizationOperationRequest request)
Retrieves the specified Operations resource.
|
Operation |
get(String operation)
Retrieves the specified Operations resource.
|
com.google.api.gax.rpc.UnaryCallable<GetGlobalOrganizationOperationRequest,Operation> |
getCallable()
Retrieves the specified Operations resource.
|
GlobalOrganizationOperationsSettings |
getSettings() |
GlobalOrganizationOperationsStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
GlobalOrganizationOperationsClient.ListPagedResponse |
list()
Retrieves a list of Operation resources contained within the specified organization.
|
GlobalOrganizationOperationsClient.ListPagedResponse |
list(ListGlobalOrganizationOperationsRequest request)
Retrieves a list of Operation resources contained within the specified organization.
|
com.google.api.gax.rpc.UnaryCallable<ListGlobalOrganizationOperationsRequest,OperationList> |
listCallable()
Retrieves a list of Operation resources contained within the specified organization.
|
com.google.api.gax.rpc.UnaryCallable<ListGlobalOrganizationOperationsRequest,GlobalOrganizationOperationsClient.ListPagedResponse> |
listPagedCallable()
Retrieves a list of Operation resources contained within the specified organization.
|
void |
shutdown() |
void |
shutdownNow() |
protected GlobalOrganizationOperationsClient(GlobalOrganizationOperationsSettings settings) throws IOException
IOExceptionprotected GlobalOrganizationOperationsClient(GlobalOrganizationOperationsStub stub)
public static final GlobalOrganizationOperationsClient create() throws IOException
IOExceptionpublic static final GlobalOrganizationOperationsClient create(GlobalOrganizationOperationsSettings settings) throws IOException
IOExceptionpublic static final GlobalOrganizationOperationsClient create(GlobalOrganizationOperationsStub stub)
public final GlobalOrganizationOperationsSettings getSettings()
public GlobalOrganizationOperationsStub getStub()
public final DeleteGlobalOrganizationOperationResponse delete(String operation)
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
String operation = "operation1662702951";
DeleteGlobalOrganizationOperationResponse response =
globalOrganizationOperationsClient.delete(operation);
}
operation - Name of the Operations resource to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final DeleteGlobalOrganizationOperationResponse delete(DeleteGlobalOrganizationOperationRequest 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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
DeleteGlobalOrganizationOperationRequest request =
DeleteGlobalOrganizationOperationRequest.newBuilder()
.setOperation("operation1662702951")
.setParentId("parentId1175162725")
.build();
DeleteGlobalOrganizationOperationResponse response =
globalOrganizationOperationsClient.delete(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<DeleteGlobalOrganizationOperationRequest,DeleteGlobalOrganizationOperationResponse> deleteCallable()
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
DeleteGlobalOrganizationOperationRequest request =
DeleteGlobalOrganizationOperationRequest.newBuilder()
.setOperation("operation1662702951")
.setParentId("parentId1175162725")
.build();
ApiFuture<DeleteGlobalOrganizationOperationResponse> future =
globalOrganizationOperationsClient.deleteCallable().futureCall(request);
// Do something.
DeleteGlobalOrganizationOperationResponse response = future.get();
}
public final Operation get(String operation)
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
String operation = "operation1662702951";
Operation response = globalOrganizationOperationsClient.get(operation);
}
operation - Name of the Operations resource to return.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Operation get(GetGlobalOrganizationOperationRequest 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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
GetGlobalOrganizationOperationRequest request =
GetGlobalOrganizationOperationRequest.newBuilder()
.setOperation("operation1662702951")
.setParentId("parentId1175162725")
.build();
Operation response = globalOrganizationOperationsClient.get(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<GetGlobalOrganizationOperationRequest,Operation> getCallable()
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
GetGlobalOrganizationOperationRequest request =
GetGlobalOrganizationOperationRequest.newBuilder()
.setOperation("operation1662702951")
.setParentId("parentId1175162725")
.build();
ApiFuture<Operation> future =
globalOrganizationOperationsClient.getCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final GlobalOrganizationOperationsClient.ListPagedResponse list()
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
for (Operation element : globalOrganizationOperationsClient.list().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 GlobalOrganizationOperationsClient.ListPagedResponse list(ListGlobalOrganizationOperationsRequest 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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
ListGlobalOrganizationOperationsRequest request =
ListGlobalOrganizationOperationsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
for (Operation element : globalOrganizationOperationsClient.list(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<ListGlobalOrganizationOperationsRequest,GlobalOrganizationOperationsClient.ListPagedResponse> listPagedCallable()
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
ListGlobalOrganizationOperationsRequest request =
ListGlobalOrganizationOperationsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
ApiFuture<Operation> future =
globalOrganizationOperationsClient.listPagedCallable().futureCall(request);
// Do something.
for (Operation element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListGlobalOrganizationOperationsRequest,OperationList> listCallable()
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 (GlobalOrganizationOperationsClient globalOrganizationOperationsClient =
GlobalOrganizationOperationsClient.create()) {
ListGlobalOrganizationOperationsRequest request =
ListGlobalOrganizationOperationsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
while (true) {
OperationList response = globalOrganizationOperationsClient.listCallable().call(request);
for (Operation element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
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 © 2024 Google LLC. All rights reserved.