@Generated(value="by gapic-generator-java") public class WorkflowsClient 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
Workflow response = workflowsClient.getWorkflow(name);
}
Note: close() needs to be called on the WorkflowsClient 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 WorkflowsSettings 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
WorkflowsSettings workflowsSettings =
WorkflowsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WorkflowsClient workflowsClient = WorkflowsClient.create(workflowsSettings);
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
WorkflowsSettings workflowsSettings =
WorkflowsSettings.newBuilder().setEndpoint(myEndpoint).build();
WorkflowsClient workflowsClient = WorkflowsClient.create(workflowsSettings);
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
WorkflowsSettings workflowsSettings = WorkflowsSettings.newHttpJsonBuilder().build();
WorkflowsClient workflowsClient = WorkflowsClient.create(workflowsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
WorkflowsClient.ListWorkflowsFixedSizeCollection |
static class |
WorkflowsClient.ListWorkflowsPage |
static class |
WorkflowsClient.ListWorkflowsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
WorkflowsClient(WorkflowsSettings settings)
Constructs an instance of WorkflowsClient, using the given settings.
|
protected |
WorkflowsClient(WorkflowsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static WorkflowsClient |
create()
Constructs an instance of WorkflowsClient with default settings.
|
static WorkflowsClient |
create(WorkflowsSettings settings)
Constructs an instance of WorkflowsClient, using the given settings.
|
static WorkflowsClient |
create(WorkflowsStub stub)
Constructs an instance of WorkflowsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> |
createWorkflowAsync(CreateWorkflowRequest request)
Creates a new workflow.
|
com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> |
createWorkflowAsync(LocationName parent,
Workflow workflow,
String workflowId)
Creates a new workflow.
|
com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> |
createWorkflowAsync(String parent,
Workflow workflow,
String workflowId)
Creates a new workflow.
|
com.google.api.gax.rpc.UnaryCallable<CreateWorkflowRequest,com.google.longrunning.Operation> |
createWorkflowCallable()
Creates a new workflow.
|
com.google.api.gax.rpc.OperationCallable<CreateWorkflowRequest,Workflow,OperationMetadata> |
createWorkflowOperationCallable()
Creates a new workflow.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteWorkflowAsync(DeleteWorkflowRequest request)
Deletes a workflow with the specified name.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteWorkflowAsync(String name)
Deletes a workflow with the specified name.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteWorkflowAsync(WorkflowName name)
Deletes a workflow with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<DeleteWorkflowRequest,com.google.longrunning.Operation> |
deleteWorkflowCallable()
Deletes a workflow with the specified name.
|
com.google.api.gax.rpc.OperationCallable<DeleteWorkflowRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteWorkflowOperationCallable()
Deletes a workflow with the specified name.
|
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.
|
WorkflowsSettings |
getSettings() |
WorkflowsStub |
getStub() |
Workflow |
getWorkflow(GetWorkflowRequest request)
Gets details of a single Workflow.
|
Workflow |
getWorkflow(String name)
Gets details of a single Workflow.
|
Workflow |
getWorkflow(WorkflowName name)
Gets details of a single Workflow.
|
com.google.api.gax.rpc.UnaryCallable<GetWorkflowRequest,Workflow> |
getWorkflowCallable()
Gets details of a single Workflow.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
WorkflowsClient.ListWorkflowsPagedResponse |
listWorkflows(ListWorkflowsRequest request)
Lists Workflows in a given project and location.
|
WorkflowsClient.ListWorkflowsPagedResponse |
listWorkflows(LocationName parent)
Lists Workflows in a given project and location.
|
WorkflowsClient.ListWorkflowsPagedResponse |
listWorkflows(String parent)
Lists Workflows in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkflowsRequest,ListWorkflowsResponse> |
listWorkflowsCallable()
Lists Workflows in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListWorkflowsRequest,WorkflowsClient.ListWorkflowsPagedResponse> |
listWorkflowsPagedCallable()
Lists Workflows in a given project and location.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> |
updateWorkflowAsync(UpdateWorkflowRequest request)
Updates an existing workflow.
|
com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> |
updateWorkflowAsync(Workflow workflow,
com.google.protobuf.FieldMask updateMask)
Updates an existing workflow.
|
com.google.api.gax.rpc.UnaryCallable<UpdateWorkflowRequest,com.google.longrunning.Operation> |
updateWorkflowCallable()
Updates an existing workflow.
|
com.google.api.gax.rpc.OperationCallable<UpdateWorkflowRequest,Workflow,OperationMetadata> |
updateWorkflowOperationCallable()
Updates an existing workflow.
|
protected WorkflowsClient(WorkflowsSettings settings) throws IOException
IOExceptionprotected WorkflowsClient(WorkflowsStub stub)
public static final WorkflowsClient create() throws IOException
IOExceptionpublic static final WorkflowsClient create(WorkflowsSettings settings) throws IOException
IOExceptionpublic static final WorkflowsClient create(WorkflowsStub stub)
public final WorkflowsSettings getSettings()
public WorkflowsStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final WorkflowsClient.ListWorkflowsPagedResponse listWorkflows(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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Project and location from which the workflows should be listed. Format:
projects/{project}/locations/{location}com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkflowsClient.ListWorkflowsPagedResponse listWorkflows(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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. Project and location from which the workflows should be listed. Format:
projects/{project}/locations/{location}com.google.api.gax.rpc.ApiException - if the remote call failspublic final WorkflowsClient.ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
ListWorkflowsRequest request =
ListWorkflowsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Workflow element : workflowsClient.listWorkflows(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<ListWorkflowsRequest,WorkflowsClient.ListWorkflowsPagedResponse> listWorkflowsPagedCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
ListWorkflowsRequest request =
ListWorkflowsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Workflow> future = workflowsClient.listWorkflowsPagedCallable().futureCall(request);
// Do something.
for (Workflow element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListWorkflowsRequest,ListWorkflowsResponse> listWorkflowsCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
ListWorkflowsRequest request =
ListWorkflowsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListWorkflowsResponse response = workflowsClient.listWorkflowsCallable().call(request);
for (Workflow element : response.getWorkflowsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Workflow getWorkflow(WorkflowName 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
Workflow response = workflowsClient.getWorkflow(name);
}
name - Required. Name of the workflow which information should be retrieved. Format:
projects/{project}/locations/{location}/workflows/{workflow}com.google.api.gax.rpc.ApiException - if the remote call failspublic final Workflow getWorkflow(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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
Workflow response = workflowsClient.getWorkflow(name);
}
name - Required. Name of the workflow which information should be retrieved. Format:
projects/{project}/locations/{location}/workflows/{workflow}com.google.api.gax.rpc.ApiException - if the remote call failspublic final Workflow getWorkflow(GetWorkflowRequest 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
GetWorkflowRequest request =
GetWorkflowRequest.newBuilder()
.setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
.build();
Workflow response = workflowsClient.getWorkflow(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<GetWorkflowRequest,Workflow> getWorkflowCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
GetWorkflowRequest request =
GetWorkflowRequest.newBuilder()
.setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
.build();
ApiFuture<Workflow> future = workflowsClient.getWorkflowCallable().futureCall(request);
// Do something.
Workflow response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> createWorkflowAsync(LocationName parent, Workflow workflow, String workflowId)
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Workflow workflow = Workflow.newBuilder().build();
String workflowId = "workflowId-360387270";
Workflow response = workflowsClient.createWorkflowAsync(parent, workflow, workflowId).get();
}
parent - Required. Project and location in which the workflow should be created. Format:
projects/{project}/locations/{location}workflow - Required. Workflow to be created.workflowId - Required. The ID of the workflow to be created. It has to fulfill the
following requirements:
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> createWorkflowAsync(String parent, Workflow workflow, String workflowId)
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Workflow workflow = Workflow.newBuilder().build();
String workflowId = "workflowId-360387270";
Workflow response = workflowsClient.createWorkflowAsync(parent, workflow, workflowId).get();
}
parent - Required. Project and location in which the workflow should be created. Format:
projects/{project}/locations/{location}workflow - Required. Workflow to be created.workflowId - Required. The ID of the workflow to be created. It has to fulfill the
following requirements:
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> createWorkflowAsync(CreateWorkflowRequest 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
CreateWorkflowRequest request =
CreateWorkflowRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setWorkflow(Workflow.newBuilder().build())
.setWorkflowId("workflowId-360387270")
.build();
Workflow response = workflowsClient.createWorkflowAsync(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<CreateWorkflowRequest,Workflow,OperationMetadata> createWorkflowOperationCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
CreateWorkflowRequest request =
CreateWorkflowRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setWorkflow(Workflow.newBuilder().build())
.setWorkflowId("workflowId-360387270")
.build();
OperationFuture<Workflow, OperationMetadata> future =
workflowsClient.createWorkflowOperationCallable().futureCall(request);
// Do something.
Workflow response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateWorkflowRequest,com.google.longrunning.Operation> createWorkflowCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
CreateWorkflowRequest request =
CreateWorkflowRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setWorkflow(Workflow.newBuilder().build())
.setWorkflowId("workflowId-360387270")
.build();
ApiFuture<Operation> future = workflowsClient.createWorkflowCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkflowAsync(WorkflowName 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
workflowsClient.deleteWorkflowAsync(name).get();
}
name - Required. Name of the workflow to be deleted. Format:
projects/{project}/locations/{location}/workflows/{workflow}com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkflowAsync(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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
workflowsClient.deleteWorkflowAsync(name).get();
}
name - Required. Name of the workflow to be deleted. Format:
projects/{project}/locations/{location}/workflows/{workflow}com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkflowAsync(DeleteWorkflowRequest 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
DeleteWorkflowRequest request =
DeleteWorkflowRequest.newBuilder()
.setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
.build();
workflowsClient.deleteWorkflowAsync(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<DeleteWorkflowRequest,com.google.protobuf.Empty,OperationMetadata> deleteWorkflowOperationCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
DeleteWorkflowRequest request =
DeleteWorkflowRequest.newBuilder()
.setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
workflowsClient.deleteWorkflowOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteWorkflowRequest,com.google.longrunning.Operation> deleteWorkflowCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
DeleteWorkflowRequest request =
DeleteWorkflowRequest.newBuilder()
.setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
.build();
ApiFuture<Operation> future = workflowsClient.deleteWorkflowCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> updateWorkflowAsync(Workflow workflow, 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
Workflow workflow = Workflow.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Workflow response = workflowsClient.updateWorkflowAsync(workflow, updateMask).get();
}
workflow - Required. Workflow to be updated.updateMask - List of fields to be updated. If not present, the entire workflow will be
updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Workflow,OperationMetadata> updateWorkflowAsync(UpdateWorkflowRequest 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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
UpdateWorkflowRequest request =
UpdateWorkflowRequest.newBuilder()
.setWorkflow(Workflow.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Workflow response = workflowsClient.updateWorkflowAsync(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<UpdateWorkflowRequest,Workflow,OperationMetadata> updateWorkflowOperationCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
UpdateWorkflowRequest request =
UpdateWorkflowRequest.newBuilder()
.setWorkflow(Workflow.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
OperationFuture<Workflow, OperationMetadata> future =
workflowsClient.updateWorkflowOperationCallable().futureCall(request);
// Do something.
Workflow response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateWorkflowRequest,com.google.longrunning.Operation> updateWorkflowCallable()
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 (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
UpdateWorkflowRequest request =
UpdateWorkflowRequest.newBuilder()
.setWorkflow(Workflow.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Operation> future = workflowsClient.updateWorkflowCallable().futureCall(request);
// Do something.
Operation response = 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.