diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java index fb9a1c2a..b72b74b7 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java @@ -48,6 +48,13 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * 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(). * @@ -161,6 +168,17 @@ public final OperationsClient getOperationsClient() { /** * Lists Workflows in a given project and location. The default order is not specified. * + *
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Project and location from which the workflows should be listed. Format: * projects/{project}/locations/{location} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -177,6 +195,17 @@ public final ListWorkflowsPagedResponse listWorkflows(LocationName parent) { /** * Lists Workflows in a given project and location. The default order is not specified. * + *
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + * for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * * @param parent Required. Project and location from which the workflows should be listed. Format: * projects/{project}/locations/{location} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -190,6 +219,24 @@ public final ListWorkflowsPagedResponse listWorkflows(String parent) { /** * Lists Workflows in a given project and location. The default order is not specified. * + *
Sample code: + * + *
{@code + * 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); + * } + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -202,6 +249,24 @@ public final ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest reque * Lists Workflows in a given project and location. The default order is not specified. * *
Sample code: + * + *
{@code + * 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*/ public final UnaryCallablefuture = workflowsClient.listWorkflowsPagedCallable().futureCall(request); + * // Do something. + * for (Workflow element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * while (true) { + * ListWorkflowsResponse response = workflowsClient.listWorkflowsCallable().call(request); + * for (Workflow element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }*/ public final UnaryCallable
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + * Workflow response = workflowsClient.getWorkflow(name); + * } + * }+ * * @param name Required. Name of the workflow which information should be retrieved. Format: * projects/{project}/locations/{location}/workflows/{workflow} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -236,6 +327,15 @@ public final Workflow getWorkflow(WorkflowName name) { /** * Gets details of a single Workflow. * + *
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString(); + * Workflow response = workflowsClient.getWorkflow(name); + * } + * }+ * * @param name Required. Name of the workflow which information should be retrieved. Format: * projects/{project}/locations/{location}/workflows/{workflow} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -249,6 +349,18 @@ public final Workflow getWorkflow(String name) { /** * Gets details of a single Workflow. * + *
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * GetWorkflowRequest request = + * GetWorkflowRequest.newBuilder() + * .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + * .build(); + * Workflow response = workflowsClient.getWorkflow(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -261,6 +373,18 @@ public final Workflow getWorkflow(GetWorkflowRequest request) { * Gets details of a single Workflow. * *
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * GetWorkflowRequest request = + * GetWorkflowRequest.newBuilder() + * .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = workflowsClient.getWorkflowCallable().futureCall(request); + * // Do something. + * Workflow response = future.get(); + * } + * }
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param parent Required. Project and location in which the workflow should be created. Format: * projects/{project}/locations/{location} * @param workflow Required. Workflow to be created. @@ -304,6 +439,17 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param parent Required. Project and location in which the workflow should be created. Format: * projects/{project}/locations/{location} * @param workflow Required. Workflow to be created. @@ -336,6 +482,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * 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(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -351,6 +511,21 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * CreateWorkflowRequest request = + * CreateWorkflowRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setWorkflow(Workflow.newBuilder().build()) + * .setWorkflowId("workflowId-360387270") + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * workflowsClient.createWorkflowOperationCallable().futureCall(request); + * // Do something. + * Workflow response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * CreateWorkflowRequest request = + * CreateWorkflowRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setWorkflow(Workflow.newBuilder().build()) + * .setWorkflowId("workflowId-360387270") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = workflowsClient.createWorkflowCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + * workflowsClient.deleteWorkflowAsync(name).get(); + * } + * }+ * * @param name Required. Name of the workflow to be deleted. Format: * projects/{project}/locations/{location}/workflows/{workflow} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -389,6 +587,15 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString(); + * workflowsClient.deleteWorkflowAsync(name).get(); + * } + * }+ * * @param name Required. Name of the workflow to be deleted. Format: * projects/{project}/locations/{location}/workflows/{workflow} * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -403,6 +610,18 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * DeleteWorkflowRequest request = + * DeleteWorkflowRequest.newBuilder() + * .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + * .build(); + * workflowsClient.deleteWorkflowAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -417,6 +636,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * DeleteWorkflowRequest request = + * DeleteWorkflowRequest.newBuilder() + * .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * workflowsClient.deleteWorkflowOperationCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * DeleteWorkflowRequest request = + * DeleteWorkflowRequest.newBuilder() + * .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = workflowsClient.deleteWorkflowCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * Workflow workflow = Workflow.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Workflow response = workflowsClient.updateWorkflowAsync(workflow, updateMask).get(); + * } + * }+ * * @param workflow Required. Workflow to be updated. * @param updateMask List of fields to be updated. If not present, the entire workflow will be * updated. @@ -458,6 +712,19 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * UpdateWorkflowRequest request = + * UpdateWorkflowRequest.newBuilder() + * .setWorkflow(Workflow.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Workflow response = workflowsClient.updateWorkflowAsync(request).get(); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -473,6 +740,20 @@ public final OperationFuture
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * UpdateWorkflowRequest request = + * UpdateWorkflowRequest.newBuilder() + * .setWorkflow(Workflow.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * OperationFuture*/ public final OperationCallablefuture = + * workflowsClient.updateWorkflowOperationCallable().futureCall(request); + * // Do something. + * Workflow response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * UpdateWorkflowRequest request = + * UpdateWorkflowRequest.newBuilder() + * .setWorkflow(Workflow.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = workflowsClient.updateWorkflowCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample for WorkflowsClient: + * + *
{@code + * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + * Workflow response = workflowsClient.getWorkflow(name); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.workflows.v1beta; diff --git a/synth.metadata b/synth.metadata index c0a24d34..ed7437a5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-workflows.git", - "sha": "9ba76337363fac2de84c22ea84386726a0a0c198" + "sha": "529aa0e71150e7e6c1f99627e0bfc6c81b8a22dd" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {