diff --git a/.repo-metadata.json b/.repo-metadata.json index d5322182..9c8ac224 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/workflows", "api_description": "allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows.", "client_documentation": "https://googleapis.dev/java/google-cloud-workflow-executions/latest/index.html", - "release_level": "beta", + "release_level": "ga", "transport": "grpc", "language": "java", "repo": "googleapis/java-workflow-executions", diff --git a/google-cloud-workflow-executions-bom/pom.xml b/google-cloud-workflow-executions-bom/pom.xml index 4c986df8..3a9a23af 100644 --- a/google-cloud-workflow-executions-bom/pom.xml +++ b/google-cloud-workflow-executions-bom/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -64,12 +64,21 @@ - com.google.cloud google-cloud-workflow-executions 0.1.9-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1beta + 0.1.9-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1 + 0.1.9-SNAPSHOT + com.google.api.grpc proto-google-cloud-workflow-executions-v1beta @@ -77,8 +86,8 @@ com.google.api.grpc - grpc-google-cloud-workflow-executions-v1beta - 0.1.9-SNAPSHOT + proto-google-cloud-workflow-executions-v1 + 0.1.9-SNAPSHOT @@ -94,4 +103,4 @@ - \ No newline at end of file + diff --git a/google-cloud-workflow-executions/pom.xml b/google-cloud-workflow-executions/pom.xml index e14816f3..58b48f95 100644 --- a/google-cloud-workflow-executions/pom.xml +++ b/google-cloud-workflow-executions/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -42,6 +42,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-workflow-executions-v1 + com.google.api.grpc proto-google-cloud-workflow-executions-v1beta @@ -72,6 +76,11 @@ grpc-google-cloud-workflow-executions-v1beta test + + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1 + test + com.google.api @@ -104,4 +113,4 @@ - \ No newline at end of file + diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsClient.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsClient.java new file mode 100644 index 00000000..57ac5392 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsClient.java @@ -0,0 +1,707 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1.stub.ExecutionsStub; +import com.google.cloud.workflows.executions.v1.stub.ExecutionsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Executions is used to start and manage running instances of + * [Workflows][google.cloud.workflows.v1.Workflow] called executions. + * + *

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 (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+ *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Execution execution = Execution.newBuilder().build();
+ *   Execution response = executionsClient.createExecution(parent, execution);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the ExecutionsClient 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: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns 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 ExecutionsSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * ExecutionsSettings executionsSettings =
+ *     ExecutionsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ExecutionsClient executionsClient = ExecutionsClient.create(executionsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * ExecutionsSettings executionsSettings =
+ *     ExecutionsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ExecutionsClient executionsClient = ExecutionsClient.create(executionsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ExecutionsClient implements BackgroundResource { + private final ExecutionsSettings settings; + private final ExecutionsStub stub; + + /** Constructs an instance of ExecutionsClient with default settings. */ + public static final ExecutionsClient create() throws IOException { + return create(ExecutionsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ExecutionsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ExecutionsClient create(ExecutionsSettings settings) throws IOException { + return new ExecutionsClient(settings); + } + + /** + * Constructs an instance of ExecutionsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ExecutionsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ExecutionsClient create(ExecutionsStub stub) { + return new ExecutionsClient(stub); + } + + /** + * Constructs an instance of ExecutionsClient, 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. + */ + protected ExecutionsClient(ExecutionsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ExecutionsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ExecutionsClient(ExecutionsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ExecutionsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ExecutionsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of executions which belong to the workflow with the given name. The method + * returns executions of all workflow revisions. Returned executions are ordered by their start + * time (newest first). + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   for (Execution element : executionsClient.listExecutions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of the workflow for which the executions should be listed. Format: + * projects/{project}/locations/{location}/workflows/{workflow} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExecutionsPagedResponse listExecutions(WorkflowName parent) { + ListExecutionsRequest request = + ListExecutionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExecutions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of executions which belong to the workflow with the given name. The method + * returns executions of all workflow revisions. Returned executions are ordered by their start + * time (newest first). + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   String parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
+   *   for (Execution element : executionsClient.listExecutions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of the workflow for which the executions should be listed. Format: + * projects/{project}/locations/{location}/workflows/{workflow} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExecutionsPagedResponse listExecutions(String parent) { + ListExecutionsRequest request = ListExecutionsRequest.newBuilder().setParent(parent).build(); + return listExecutions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of executions which belong to the workflow with the given name. The method + * returns executions of all workflow revisions. Returned executions are ordered by their start + * time (newest first). + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ListExecutionsRequest request =
+   *       ListExecutionsRequest.newBuilder()
+   *           .setParent(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setView(ExecutionView.forNumber(0))
+   *           .build();
+   *   for (Execution element : executionsClient.listExecutions(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 + */ + public final ListExecutionsPagedResponse listExecutions(ListExecutionsRequest request) { + return listExecutionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of executions which belong to the workflow with the given name. The method + * returns executions of all workflow revisions. Returned executions are ordered by their start + * time (newest first). + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ListExecutionsRequest request =
+   *       ListExecutionsRequest.newBuilder()
+   *           .setParent(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setView(ExecutionView.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       executionsClient.listExecutionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Execution element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listExecutionsPagedCallable() { + return stub.listExecutionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of executions which belong to the workflow with the given name. The method + * returns executions of all workflow revisions. Returned executions are ordered by their start + * time (newest first). + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ListExecutionsRequest request =
+   *       ListExecutionsRequest.newBuilder()
+   *           .setParent(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setView(ExecutionView.forNumber(0))
+   *           .build();
+   *   while (true) {
+   *     ListExecutionsResponse response = executionsClient.listExecutionsCallable().call(request);
+   *     for (Execution element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listExecutionsCallable() { + return stub.listExecutionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new execution using the latest revision of the given workflow. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   Execution execution = Execution.newBuilder().build();
+   *   Execution response = executionsClient.createExecution(parent, execution);
+   * }
+   * }
+ * + * @param parent Required. Name of the workflow for which an execution should be created. Format: + * projects/{project}/locations/{location}/workflows/{workflow} The latest revision of the + * workflow will be used. + * @param execution Required. Execution to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution createExecution(WorkflowName parent, Execution execution) { + CreateExecutionRequest request = + CreateExecutionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExecution(execution) + .build(); + return createExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new execution using the latest revision of the given workflow. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   String parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
+   *   Execution execution = Execution.newBuilder().build();
+   *   Execution response = executionsClient.createExecution(parent, execution);
+   * }
+   * }
+ * + * @param parent Required. Name of the workflow for which an execution should be created. Format: + * projects/{project}/locations/{location}/workflows/{workflow} The latest revision of the + * workflow will be used. + * @param execution Required. Execution to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution createExecution(String parent, Execution execution) { + CreateExecutionRequest request = + CreateExecutionRequest.newBuilder().setParent(parent).setExecution(execution).build(); + return createExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new execution using the latest revision of the given workflow. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   CreateExecutionRequest request =
+   *       CreateExecutionRequest.newBuilder()
+   *           .setParent(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .setExecution(Execution.newBuilder().build())
+   *           .build();
+   *   Execution response = executionsClient.createExecution(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 + */ + public final Execution createExecution(CreateExecutionRequest request) { + return createExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new execution using the latest revision of the given workflow. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   CreateExecutionRequest request =
+   *       CreateExecutionRequest.newBuilder()
+   *           .setParent(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .setExecution(Execution.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = executionsClient.createExecutionCallable().futureCall(request);
+   *   // Do something.
+   *   Execution response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createExecutionCallable() { + return stub.createExecutionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]");
+   *   Execution response = executionsClient.getExecution(name);
+   * }
+   * }
+ * + * @param name Required. Name of the execution to be retrieved. Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution getExecution(ExecutionName name) { + GetExecutionRequest request = + GetExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   String name =
+   *       ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString();
+   *   Execution response = executionsClient.getExecution(name);
+   * }
+   * }
+ * + * @param name Required. Name of the execution to be retrieved. Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution getExecution(String name) { + GetExecutionRequest request = GetExecutionRequest.newBuilder().setName(name).build(); + return getExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   GetExecutionRequest request =
+   *       GetExecutionRequest.newBuilder()
+   *           .setName(
+   *               ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]")
+   *                   .toString())
+   *           .setView(ExecutionView.forNumber(0))
+   *           .build();
+   *   Execution response = executionsClient.getExecution(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 + */ + public final Execution getExecution(GetExecutionRequest request) { + return getExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   GetExecutionRequest request =
+   *       GetExecutionRequest.newBuilder()
+   *           .setName(
+   *               ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]")
+   *                   .toString())
+   *           .setView(ExecutionView.forNumber(0))
+   *           .build();
+   *   ApiFuture future = executionsClient.getExecutionCallable().futureCall(request);
+   *   // Do something.
+   *   Execution response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getExecutionCallable() { + return stub.getExecutionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]");
+   *   Execution response = executionsClient.cancelExecution(name);
+   * }
+   * }
+ * + * @param name Required. Name of the execution to be cancelled. Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution cancelExecution(ExecutionName name) { + CancelExecutionRequest request = + CancelExecutionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return cancelExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   String name =
+   *       ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString();
+   *   Execution response = executionsClient.cancelExecution(name);
+   * }
+   * }
+ * + * @param name Required. Name of the execution to be cancelled. Format: + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution cancelExecution(String name) { + CancelExecutionRequest request = CancelExecutionRequest.newBuilder().setName(name).build(); + return cancelExecution(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   CancelExecutionRequest request =
+   *       CancelExecutionRequest.newBuilder()
+   *           .setName(
+   *               ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]")
+   *                   .toString())
+   *           .build();
+   *   Execution response = executionsClient.cancelExecution(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 + */ + public final Execution cancelExecution(CancelExecutionRequest request) { + return cancelExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Cancels an execution of the given name. + * + *

Sample code: + * + *

{@code
+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   CancelExecutionRequest request =
+   *       CancelExecutionRequest.newBuilder()
+   *           .setName(
+   *               ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = executionsClient.cancelExecutionCallable().futureCall(request);
+   *   // Do something.
+   *   Execution response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable cancelExecutionCallable() { + return stub.cancelExecutionCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListExecutionsPagedResponse + extends AbstractPagedListResponse< + ListExecutionsRequest, + ListExecutionsResponse, + Execution, + ListExecutionsPage, + ListExecutionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListExecutionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListExecutionsPagedResponse apply(ListExecutionsPage input) { + return new ListExecutionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListExecutionsPagedResponse(ListExecutionsPage page) { + super(page, ListExecutionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListExecutionsPage + extends AbstractPage< + ListExecutionsRequest, ListExecutionsResponse, Execution, ListExecutionsPage> { + + private ListExecutionsPage( + PageContext context, + ListExecutionsResponse response) { + super(context, response); + } + + private static ListExecutionsPage createEmptyPage() { + return new ListExecutionsPage(null, null); + } + + @Override + protected ListExecutionsPage createPage( + PageContext context, + ListExecutionsResponse response) { + return new ListExecutionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListExecutionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListExecutionsRequest, + ListExecutionsResponse, + Execution, + ListExecutionsPage, + ListExecutionsFixedSizeCollection> { + + private ListExecutionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListExecutionsFixedSizeCollection createEmptyCollection() { + return new ListExecutionsFixedSizeCollection(null, 0); + } + + @Override + protected ListExecutionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListExecutionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsSettings.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsSettings.java new file mode 100644 index 00000000..8e7bc9b1 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsSettings.java @@ -0,0 +1,218 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import static com.google.cloud.workflows.executions.v1.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.workflows.executions.v1.stub.ExecutionsStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ExecutionsClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (workflowexecutions.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createExecution to 30 seconds: + * + *

{@code
+ * ExecutionsSettings.Builder executionsSettingsBuilder = ExecutionsSettings.newBuilder();
+ * executionsSettingsBuilder
+ *     .createExecutionSettings()
+ *     .setRetrySettings(
+ *         executionsSettingsBuilder
+ *             .createExecutionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ExecutionsSettings executionsSettings = executionsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ExecutionsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listExecutions. */ + public PagedCallSettings< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings() { + return ((ExecutionsStubSettings) getStubSettings()).listExecutionsSettings(); + } + + /** Returns the object with the settings used for calls to createExecution. */ + public UnaryCallSettings createExecutionSettings() { + return ((ExecutionsStubSettings) getStubSettings()).createExecutionSettings(); + } + + /** Returns the object with the settings used for calls to getExecution. */ + public UnaryCallSettings getExecutionSettings() { + return ((ExecutionsStubSettings) getStubSettings()).getExecutionSettings(); + } + + /** Returns the object with the settings used for calls to cancelExecution. */ + public UnaryCallSettings cancelExecutionSettings() { + return ((ExecutionsStubSettings) getStubSettings()).cancelExecutionSettings(); + } + + public static final ExecutionsSettings create(ExecutionsStubSettings stub) throws IOException { + return new ExecutionsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ExecutionsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ExecutionsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ExecutionsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ExecutionsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ExecutionsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ExecutionsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ExecutionsStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ExecutionsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ExecutionsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ExecutionsStubSettings.newBuilder(clientContext)); + } + + protected Builder(ExecutionsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ExecutionsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ExecutionsStubSettings.newBuilder()); + } + + public ExecutionsStubSettings.Builder getStubSettingsBuilder() { + return ((ExecutionsStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listExecutions. */ + public PagedCallSettings.Builder< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings() { + return getStubSettingsBuilder().listExecutionsSettings(); + } + + /** Returns the builder for the settings used for calls to createExecution. */ + public UnaryCallSettings.Builder createExecutionSettings() { + return getStubSettingsBuilder().createExecutionSettings(); + } + + /** Returns the builder for the settings used for calls to getExecution. */ + public UnaryCallSettings.Builder getExecutionSettings() { + return getStubSettingsBuilder().getExecutionSettings(); + } + + /** Returns the builder for the settings used for calls to cancelExecution. */ + public UnaryCallSettings.Builder cancelExecutionSettings() { + return getStubSettingsBuilder().cancelExecutionSettings(); + } + + @Override + public ExecutionsSettings build() throws IOException { + return new ExecutionsSettings(this); + } + } +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/gapic_metadata.json b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/gapic_metadata.json new file mode 100644 index 00000000..f9fec60c --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/gapic_metadata.json @@ -0,0 +1,30 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.workflows.executions.v1", + "libraryPackage": "com.google.cloud.workflows.executions.v1", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "ExecutionsClient", + "rpcs": { + "CancelExecution": { + "methods": ["cancelExecution", "cancelExecution", "cancelExecution", "cancelExecutionCallable"] + }, + "CreateExecution": { + "methods": ["createExecution", "createExecution", "createExecution", "createExecutionCallable"] + }, + "GetExecution": { + "methods": ["getExecution", "getExecution", "getExecution", "getExecutionCallable"] + }, + "ListExecutions": { + "methods": ["listExecutions", "listExecutions", "listExecutions", "listExecutionsPagedCallable", "listExecutionsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/package-info.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/package-info.java new file mode 100644 index 00000000..ac3c7afd --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/package-info.java @@ -0,0 +1,38 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= ExecutionsClient ======================= + * + *

Service Description: Executions is used to start and manage running instances of + * [Workflows][google.cloud.workflows.v1.Workflow] called executions. + * + *

Sample for ExecutionsClient: + * + *

{@code
+ * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+ *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Execution execution = Execution.newBuilder().build();
+ *   Execution response = executionsClient.createExecution(parent, execution);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.workflows.executions.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/ExecutionsStub.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/ExecutionsStub.java new file mode 100644 index 00000000..c2fb64b0 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/ExecutionsStub.java @@ -0,0 +1,63 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1.stub; + +import static com.google.cloud.workflows.executions.v1.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1.CancelExecutionRequest; +import com.google.cloud.workflows.executions.v1.CreateExecutionRequest; +import com.google.cloud.workflows.executions.v1.Execution; +import com.google.cloud.workflows.executions.v1.GetExecutionRequest; +import com.google.cloud.workflows.executions.v1.ListExecutionsRequest; +import com.google.cloud.workflows.executions.v1.ListExecutionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Executions service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ExecutionsStub implements BackgroundResource { + + public UnaryCallable + listExecutionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listExecutionsPagedCallable()"); + } + + public UnaryCallable listExecutionsCallable() { + throw new UnsupportedOperationException("Not implemented: listExecutionsCallable()"); + } + + public UnaryCallable createExecutionCallable() { + throw new UnsupportedOperationException("Not implemented: createExecutionCallable()"); + } + + public UnaryCallable getExecutionCallable() { + throw new UnsupportedOperationException("Not implemented: getExecutionCallable()"); + } + + public UnaryCallable cancelExecutionCallable() { + throw new UnsupportedOperationException("Not implemented: cancelExecutionCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/ExecutionsStubSettings.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/ExecutionsStubSettings.java new file mode 100644 index 00000000..d2303b2e --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/ExecutionsStubSettings.java @@ -0,0 +1,399 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1.stub; + +import static com.google.cloud.workflows.executions.v1.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1.CancelExecutionRequest; +import com.google.cloud.workflows.executions.v1.CreateExecutionRequest; +import com.google.cloud.workflows.executions.v1.Execution; +import com.google.cloud.workflows.executions.v1.GetExecutionRequest; +import com.google.cloud.workflows.executions.v1.ListExecutionsRequest; +import com.google.cloud.workflows.executions.v1.ListExecutionsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ExecutionsStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (workflowexecutions.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createExecution to 30 seconds: + * + *

{@code
+ * ExecutionsStubSettings.Builder executionsSettingsBuilder = ExecutionsStubSettings.newBuilder();
+ * executionsSettingsBuilder
+ *     .createExecutionSettings()
+ *     .setRetrySettings(
+ *         executionsSettingsBuilder
+ *             .createExecutionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ExecutionsStubSettings executionsSettings = executionsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ExecutionsStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings; + private final UnaryCallSettings createExecutionSettings; + private final UnaryCallSettings getExecutionSettings; + private final UnaryCallSettings cancelExecutionSettings; + + private static final PagedListDescriptor + LIST_EXECUTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListExecutionsRequest injectToken(ListExecutionsRequest payload, String token) { + return ListExecutionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListExecutionsRequest injectPageSize( + ListExecutionsRequest payload, int pageSize) { + return ListExecutionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListExecutionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListExecutionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListExecutionsResponse payload) { + return payload.getExecutionsList() == null + ? ImmutableList.of() + : payload.getExecutionsList(); + } + }; + + private static final PagedListResponseFactory< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + LIST_EXECUTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListExecutionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_EXECUTIONS_PAGE_STR_DESC, request, context); + return ListExecutionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listExecutions. */ + public PagedCallSettings< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings() { + return listExecutionsSettings; + } + + /** Returns the object with the settings used for calls to createExecution. */ + public UnaryCallSettings createExecutionSettings() { + return createExecutionSettings; + } + + /** Returns the object with the settings used for calls to getExecution. */ + public UnaryCallSettings getExecutionSettings() { + return getExecutionSettings; + } + + /** Returns the object with the settings used for calls to cancelExecution. */ + public UnaryCallSettings cancelExecutionSettings() { + return cancelExecutionSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ExecutionsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcExecutionsStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "workflowexecutions.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ExecutionsStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ExecutionsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listExecutionsSettings = settingsBuilder.listExecutionsSettings().build(); + createExecutionSettings = settingsBuilder.createExecutionSettings().build(); + getExecutionSettings = settingsBuilder.getExecutionSettings().build(); + cancelExecutionSettings = settingsBuilder.cancelExecutionSettings().build(); + } + + /** Builder for ExecutionsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings; + private final UnaryCallSettings.Builder + createExecutionSettings; + private final UnaryCallSettings.Builder getExecutionSettings; + private final UnaryCallSettings.Builder + cancelExecutionSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listExecutionsSettings = PagedCallSettings.newBuilder(LIST_EXECUTIONS_PAGE_STR_FACT); + createExecutionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getExecutionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + cancelExecutionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listExecutionsSettings, + createExecutionSettings, + getExecutionSettings, + cancelExecutionSettings); + initDefaults(this); + } + + protected Builder(ExecutionsStubSettings settings) { + super(settings); + + listExecutionsSettings = settings.listExecutionsSettings.toBuilder(); + createExecutionSettings = settings.createExecutionSettings.toBuilder(); + getExecutionSettings = settings.getExecutionSettings.toBuilder(); + cancelExecutionSettings = settings.cancelExecutionSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listExecutionsSettings, + createExecutionSettings, + getExecutionSettings, + cancelExecutionSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listExecutionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createExecutionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getExecutionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .cancelExecutionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listExecutions. */ + public PagedCallSettings.Builder< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings() { + return listExecutionsSettings; + } + + /** Returns the builder for the settings used for calls to createExecution. */ + public UnaryCallSettings.Builder createExecutionSettings() { + return createExecutionSettings; + } + + /** Returns the builder for the settings used for calls to getExecution. */ + public UnaryCallSettings.Builder getExecutionSettings() { + return getExecutionSettings; + } + + /** Returns the builder for the settings used for calls to cancelExecution. */ + public UnaryCallSettings.Builder cancelExecutionSettings() { + return cancelExecutionSettings; + } + + @Override + public ExecutionsStubSettings build() throws IOException { + return new ExecutionsStubSettings(this); + } + } +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/GrpcExecutionsCallableFactory.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/GrpcExecutionsCallableFactory.java new file mode 100644 index 00000000..0c913827 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/GrpcExecutionsCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Executions service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcExecutionsCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/GrpcExecutionsStub.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/GrpcExecutionsStub.java new file mode 100644 index 00000000..e6d0b521 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1/stub/GrpcExecutionsStub.java @@ -0,0 +1,273 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1.stub; + +import static com.google.cloud.workflows.executions.v1.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1.CancelExecutionRequest; +import com.google.cloud.workflows.executions.v1.CreateExecutionRequest; +import com.google.cloud.workflows.executions.v1.Execution; +import com.google.cloud.workflows.executions.v1.GetExecutionRequest; +import com.google.cloud.workflows.executions.v1.ListExecutionsRequest; +import com.google.cloud.workflows.executions.v1.ListExecutionsResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Executions service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcExecutionsStub extends ExecutionsStub { + private static final MethodDescriptor + listExecutionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.executions.v1.Executions/ListExecutions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListExecutionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListExecutionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createExecutionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.executions.v1.Executions/CreateExecution") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateExecutionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Execution.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getExecutionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.executions.v1.Executions/GetExecution") + .setRequestMarshaller(ProtoUtils.marshaller(GetExecutionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Execution.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + cancelExecutionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.executions.v1.Executions/CancelExecution") + .setRequestMarshaller( + ProtoUtils.marshaller(CancelExecutionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Execution.getDefaultInstance())) + .build(); + + private final UnaryCallable listExecutionsCallable; + private final UnaryCallable + listExecutionsPagedCallable; + private final UnaryCallable createExecutionCallable; + private final UnaryCallable getExecutionCallable; + private final UnaryCallable cancelExecutionCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcExecutionsStub create(ExecutionsStubSettings settings) + throws IOException { + return new GrpcExecutionsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcExecutionsStub create(ClientContext clientContext) throws IOException { + return new GrpcExecutionsStub(ExecutionsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcExecutionsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcExecutionsStub( + ExecutionsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcExecutionsStub, 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. + */ + protected GrpcExecutionsStub(ExecutionsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcExecutionsCallableFactory()); + } + + /** + * Constructs an instance of GrpcExecutionsStub, 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. + */ + protected GrpcExecutionsStub( + ExecutionsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listExecutionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listExecutionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListExecutionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createExecutionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createExecutionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateExecutionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getExecutionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getExecutionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetExecutionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings cancelExecutionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cancelExecutionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CancelExecutionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listExecutionsCallable = + callableFactory.createUnaryCallable( + listExecutionsTransportSettings, settings.listExecutionsSettings(), clientContext); + this.listExecutionsPagedCallable = + callableFactory.createPagedCallable( + listExecutionsTransportSettings, settings.listExecutionsSettings(), clientContext); + this.createExecutionCallable = + callableFactory.createUnaryCallable( + createExecutionTransportSettings, settings.createExecutionSettings(), clientContext); + this.getExecutionCallable = + callableFactory.createUnaryCallable( + getExecutionTransportSettings, settings.getExecutionSettings(), clientContext); + this.cancelExecutionCallable = + callableFactory.createUnaryCallable( + cancelExecutionTransportSettings, settings.cancelExecutionSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listExecutionsCallable() { + return listExecutionsCallable; + } + + @Override + public UnaryCallable + listExecutionsPagedCallable() { + return listExecutionsPagedCallable; + } + + @Override + public UnaryCallable createExecutionCallable() { + return createExecutionCallable; + } + + @Override + public UnaryCallable getExecutionCallable() { + return getExecutionCallable; + } + + @Override + public UnaryCallable cancelExecutionCallable() { + return cancelExecutionCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/ExecutionsClientTest.java b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/ExecutionsClientTest.java new file mode 100644 index 00000000..e202cce3 --- /dev/null +++ b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/ExecutionsClientTest.java @@ -0,0 +1,445 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import static com.google.cloud.workflows.executions.v1.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class ExecutionsClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockExecutions mockExecutions; + private ExecutionsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockExecutions = new MockExecutions(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockExecutions)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ExecutionsSettings settings = + ExecutionsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ExecutionsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listExecutionsTest() throws Exception { + Execution responsesElement = Execution.newBuilder().build(); + ListExecutionsResponse expectedResponse = + ListExecutionsResponse.newBuilder() + .setNextPageToken("") + .addAllExecutions(Arrays.asList(responsesElement)) + .build(); + mockExecutions.addResponse(expectedResponse); + + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + + ListExecutionsPagedResponse pagedListResponse = client.listExecutions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExecutionsList().get(0), resources.get(0)); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExecutionsRequest actualRequest = ((ListExecutionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExecutionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + client.listExecutions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExecutionsTest2() throws Exception { + Execution responsesElement = Execution.newBuilder().build(); + ListExecutionsResponse expectedResponse = + ListExecutionsResponse.newBuilder() + .setNextPageToken("") + .addAllExecutions(Arrays.asList(responsesElement)) + .build(); + mockExecutions.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListExecutionsPagedResponse pagedListResponse = client.listExecutions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExecutionsList().get(0), resources.get(0)); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExecutionsRequest actualRequest = ((ListExecutionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExecutionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + String parent = "parent-995424086"; + client.listExecutions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExecutionTest() throws Exception { + Execution expectedResponse = + Execution.newBuilder() + .setName( + ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setArgument("argument-1589682499") + .setResult("result-934426595") + .setError(Execution.Error.newBuilder().build()) + .setWorkflowRevisionId("workflowRevisionId-1575712907") + .build(); + mockExecutions.addResponse(expectedResponse); + + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + Execution execution = Execution.newBuilder().build(); + + Execution actualResponse = client.createExecution(parent, execution); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExecutionRequest actualRequest = ((CreateExecutionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(execution, actualRequest.getExecution()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExecutionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + Execution execution = Execution.newBuilder().build(); + client.createExecution(parent, execution); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExecutionTest2() throws Exception { + Execution expectedResponse = + Execution.newBuilder() + .setName( + ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setArgument("argument-1589682499") + .setResult("result-934426595") + .setError(Execution.Error.newBuilder().build()) + .setWorkflowRevisionId("workflowRevisionId-1575712907") + .build(); + mockExecutions.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Execution execution = Execution.newBuilder().build(); + + Execution actualResponse = client.createExecution(parent, execution); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExecutionRequest actualRequest = ((CreateExecutionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(execution, actualRequest.getExecution()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExecutionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + String parent = "parent-995424086"; + Execution execution = Execution.newBuilder().build(); + client.createExecution(parent, execution); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExecutionTest() throws Exception { + Execution expectedResponse = + Execution.newBuilder() + .setName( + ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setArgument("argument-1589682499") + .setResult("result-934426595") + .setError(Execution.Error.newBuilder().build()) + .setWorkflowRevisionId("workflowRevisionId-1575712907") + .build(); + mockExecutions.addResponse(expectedResponse); + + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + + Execution actualResponse = client.getExecution(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExecutionRequest actualRequest = ((GetExecutionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExecutionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + client.getExecution(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExecutionTest2() throws Exception { + Execution expectedResponse = + Execution.newBuilder() + .setName( + ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setArgument("argument-1589682499") + .setResult("result-934426595") + .setError(Execution.Error.newBuilder().build()) + .setWorkflowRevisionId("workflowRevisionId-1575712907") + .build(); + mockExecutions.addResponse(expectedResponse); + + String name = "name3373707"; + + Execution actualResponse = client.getExecution(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExecutionRequest actualRequest = ((GetExecutionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExecutionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + String name = "name3373707"; + client.getExecution(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelExecutionTest() throws Exception { + Execution expectedResponse = + Execution.newBuilder() + .setName( + ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setArgument("argument-1589682499") + .setResult("result-934426595") + .setError(Execution.Error.newBuilder().build()) + .setWorkflowRevisionId("workflowRevisionId-1575712907") + .build(); + mockExecutions.addResponse(expectedResponse); + + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + + Execution actualResponse = client.cancelExecution(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CancelExecutionRequest actualRequest = ((CancelExecutionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cancelExecutionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + client.cancelExecution(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void cancelExecutionTest2() throws Exception { + Execution expectedResponse = + Execution.newBuilder() + .setName( + ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]").toString()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setArgument("argument-1589682499") + .setResult("result-934426595") + .setError(Execution.Error.newBuilder().build()) + .setWorkflowRevisionId("workflowRevisionId-1575712907") + .build(); + mockExecutions.addResponse(expectedResponse); + + String name = "name3373707"; + + Execution actualResponse = client.cancelExecution(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CancelExecutionRequest actualRequest = ((CancelExecutionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void cancelExecutionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + String name = "name3373707"; + client.cancelExecution(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/MockExecutions.java b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/MockExecutions.java new file mode 100644 index 00000000..3355c577 --- /dev/null +++ b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/MockExecutions.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockExecutions implements MockGrpcService { + private final MockExecutionsImpl serviceImpl; + + public MockExecutions() { + serviceImpl = new MockExecutionsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/MockExecutionsImpl.java b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/MockExecutionsImpl.java new file mode 100644 index 00000000..f3777544 --- /dev/null +++ b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1/MockExecutionsImpl.java @@ -0,0 +1,144 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.workflows.executions.v1.ExecutionsGrpc.ExecutionsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockExecutionsImpl extends ExecutionsImplBase { + private List requests; + private Queue responses; + + public MockExecutionsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listExecutions( + ListExecutionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListExecutionsResponse) { + requests.add(request); + responseObserver.onNext(((ListExecutionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListExecutions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListExecutionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createExecution( + CreateExecutionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Execution) { + requests.add(request); + responseObserver.onNext(((Execution) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateExecution, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Execution.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getExecution( + GetExecutionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Execution) { + requests.add(request); + responseObserver.onNext(((Execution) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetExecution, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Execution.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void cancelExecution( + CancelExecutionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Execution) { + requests.add(request); + responseObserver.onNext(((Execution) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CancelExecution, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Execution.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-workflow-executions-v1/pom.xml b/grpc-google-cloud-workflow-executions-v1/pom.xml new file mode 100644 index 00000000..2ca1e05f --- /dev/null +++ b/grpc-google-cloud-workflow-executions-v1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1 + 0.1.9-SNAPSHOT + grpc-google-cloud-workflow-executions-v1 + GRPC library for google-cloud-workflow-executions + + com.google.cloud + google-cloud-workflow-executions-parent + 0.1.9-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-workflow-executions-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsGrpc.java b/grpc-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsGrpc.java new file mode 100644 index 00000000..01e77f7a --- /dev/null +++ b/grpc-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsGrpc.java @@ -0,0 +1,738 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Executions is used to start and manage running instances of
+ * [Workflows][google.cloud.workflows.v1.Workflow] called executions.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/workflows/executions/v1/executions.proto") +public final class ExecutionsGrpc { + + private ExecutionsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.workflows.executions.v1.Executions"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1.ListExecutionsResponse> + getListExecutionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListExecutions", + requestType = com.google.cloud.workflows.executions.v1.ListExecutionsRequest.class, + responseType = com.google.cloud.workflows.executions.v1.ListExecutionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1.ListExecutionsResponse> + getListExecutionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1.ListExecutionsResponse> + getListExecutionsMethod; + if ((getListExecutionsMethod = ExecutionsGrpc.getListExecutionsMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getListExecutionsMethod = ExecutionsGrpc.getListExecutionsMethod) == null) { + ExecutionsGrpc.getListExecutionsMethod = + getListExecutionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListExecutions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.ListExecutionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ExecutionsMethodDescriptorSupplier("ListExecutions")) + .build(); + } + } + } + return getListExecutionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getCreateExecutionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateExecution", + requestType = com.google.cloud.workflows.executions.v1.CreateExecutionRequest.class, + responseType = com.google.cloud.workflows.executions.v1.Execution.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getCreateExecutionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getCreateExecutionMethod; + if ((getCreateExecutionMethod = ExecutionsGrpc.getCreateExecutionMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getCreateExecutionMethod = ExecutionsGrpc.getCreateExecutionMethod) == null) { + ExecutionsGrpc.getCreateExecutionMethod = + getCreateExecutionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateExecution")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.Execution + .getDefaultInstance())) + .setSchemaDescriptor( + new ExecutionsMethodDescriptorSupplier("CreateExecution")) + .build(); + } + } + } + return getCreateExecutionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.GetExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getGetExecutionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetExecution", + requestType = com.google.cloud.workflows.executions.v1.GetExecutionRequest.class, + responseType = com.google.cloud.workflows.executions.v1.Execution.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.GetExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getGetExecutionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.GetExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getGetExecutionMethod; + if ((getGetExecutionMethod = ExecutionsGrpc.getGetExecutionMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getGetExecutionMethod = ExecutionsGrpc.getGetExecutionMethod) == null) { + ExecutionsGrpc.getGetExecutionMethod = + getGetExecutionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetExecution")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.GetExecutionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.Execution + .getDefaultInstance())) + .setSchemaDescriptor(new ExecutionsMethodDescriptorSupplier("GetExecution")) + .build(); + } + } + } + return getGetExecutionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getCancelExecutionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CancelExecution", + requestType = com.google.cloud.workflows.executions.v1.CancelExecutionRequest.class, + responseType = com.google.cloud.workflows.executions.v1.Execution.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getCancelExecutionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution> + getCancelExecutionMethod; + if ((getCancelExecutionMethod = ExecutionsGrpc.getCancelExecutionMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getCancelExecutionMethod = ExecutionsGrpc.getCancelExecutionMethod) == null) { + ExecutionsGrpc.getCancelExecutionMethod = + getCancelExecutionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CancelExecution")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1.Execution + .getDefaultInstance())) + .setSchemaDescriptor( + new ExecutionsMethodDescriptorSupplier("CancelExecution")) + .build(); + } + } + } + return getCancelExecutionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ExecutionsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ExecutionsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsStub(channel, callOptions); + } + }; + return ExecutionsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ExecutionsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ExecutionsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsBlockingStub(channel, callOptions); + } + }; + return ExecutionsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ExecutionsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ExecutionsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsFutureStub(channel, callOptions); + } + }; + return ExecutionsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1.Workflow] called executions.
+   * 
+ */ + public abstract static class ExecutionsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public void listExecutions( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListExecutionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public void createExecution( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateExecutionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public void getExecution( + com.google.cloud.workflows.executions.v1.GetExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetExecutionMethod(), responseObserver); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public void cancelExecution( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCancelExecutionMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListExecutionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1.ListExecutionsResponse>( + this, METHODID_LIST_EXECUTIONS))) + .addMethod( + getCreateExecutionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution>( + this, METHODID_CREATE_EXECUTION))) + .addMethod( + getGetExecutionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1.GetExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution>( + this, METHODID_GET_EXECUTION))) + .addMethod( + getCancelExecutionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1.Execution>( + this, METHODID_CANCEL_EXECUTION))) + .build(); + } + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1.Workflow] called executions.
+   * 
+ */ + public static final class ExecutionsStub extends io.grpc.stub.AbstractAsyncStub { + private ExecutionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ExecutionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public void listExecutions( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListExecutionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public void createExecution( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateExecutionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public void getExecution( + com.google.cloud.workflows.executions.v1.GetExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetExecutionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public void cancelExecution( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCancelExecutionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1.Workflow] called executions.
+   * 
+ */ + public static final class ExecutionsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ExecutionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ExecutionsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public com.google.cloud.workflows.executions.v1.ListExecutionsResponse listExecutions( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListExecutionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public com.google.cloud.workflows.executions.v1.Execution createExecution( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateExecutionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public com.google.cloud.workflows.executions.v1.Execution getExecution( + com.google.cloud.workflows.executions.v1.GetExecutionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetExecutionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public com.google.cloud.workflows.executions.v1.Execution cancelExecution( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCancelExecutionMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1.Workflow] called executions.
+   * 
+ */ + public static final class ExecutionsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ExecutionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ExecutionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1.ListExecutionsResponse> + listExecutions(com.google.cloud.workflows.executions.v1.ListExecutionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListExecutionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1.Execution> + createExecution(com.google.cloud.workflows.executions.v1.CreateExecutionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateExecutionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1.Execution> + getExecution(com.google.cloud.workflows.executions.v1.GetExecutionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetExecutionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1.Execution> + cancelExecution(com.google.cloud.workflows.executions.v1.CancelExecutionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCancelExecutionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_EXECUTIONS = 0; + private static final int METHODID_CREATE_EXECUTION = 1; + private static final int METHODID_GET_EXECUTION = 2; + private static final int METHODID_CANCEL_EXECUTION = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ExecutionsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ExecutionsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_EXECUTIONS: + serviceImpl.listExecutions( + (com.google.cloud.workflows.executions.v1.ListExecutionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workflows.executions.v1.ListExecutionsResponse>) + responseObserver); + break; + case METHODID_CREATE_EXECUTION: + serviceImpl.createExecution( + (com.google.cloud.workflows.executions.v1.CreateExecutionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_EXECUTION: + serviceImpl.getExecution( + (com.google.cloud.workflows.executions.v1.GetExecutionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CANCEL_EXECUTION: + serviceImpl.cancelExecution( + (com.google.cloud.workflows.executions.v1.CancelExecutionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ExecutionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ExecutionsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Executions"); + } + } + + private static final class ExecutionsFileDescriptorSupplier + extends ExecutionsBaseDescriptorSupplier { + ExecutionsFileDescriptorSupplier() {} + } + + private static final class ExecutionsMethodDescriptorSupplier + extends ExecutionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ExecutionsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ExecutionsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ExecutionsFileDescriptorSupplier()) + .addMethod(getListExecutionsMethod()) + .addMethod(getCreateExecutionMethod()) + .addMethod(getGetExecutionMethod()) + .addMethod(getCancelExecutionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index de5290ef..53021951 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,16 @@ google-cloud-workflow-executions 0.1.9-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-workflow-executions-v1 + 0.1.9-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1 + 0.1.9-SNAPSHOT + com.google.api.grpc proto-google-cloud-workflow-executions-v1beta @@ -112,8 +122,10 @@ google-cloud-workflow-executions - proto-google-cloud-workflow-executions-v1beta grpc-google-cloud-workflow-executions-v1beta + grpc-google-cloud-workflow-executions-v1 + proto-google-cloud-workflow-executions-v1beta + proto-google-cloud-workflow-executions-v1 google-cloud-workflow-executions-bom diff --git a/proto-google-cloud-workflow-executions-v1/clirr-ignored-differences.xml b/proto-google-cloud-workflow-executions-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..f4250a59 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/workflows/executions/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/workflows/executions/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/workflows/executions/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-workflow-executions-v1/pom.xml b/proto-google-cloud-workflow-executions-v1/pom.xml new file mode 100644 index 00000000..596af261 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-workflow-executions-v1 + 0.1.9-SNAPSHOT + proto-google-cloud-workflow-executions-v1 + Proto library for google-cloud-workflow-executions + + com.google.cloud + google-cloud-workflow-executions-parent + 0.1.9-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CancelExecutionRequest.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CancelExecutionRequest.java new file mode 100644 index 00000000..37f9bf6b --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CancelExecutionRequest.java @@ -0,0 +1,676 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +/** + * + * + *
+ * Request for the
+ * [CancelExecution][google.cloud.workflows.executions.v1.Executions.CancelExecution]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.CancelExecutionRequest} + */ +public final class CancelExecutionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.CancelExecutionRequest) + CancelExecutionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CancelExecutionRequest.newBuilder() to construct. + private CancelExecutionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CancelExecutionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CancelExecutionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CancelExecutionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest.class, + com.google.cloud.workflows.executions.v1.CancelExecutionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.CancelExecutionRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.CancelExecutionRequest other = + (com.google.cloud.workflows.executions.v1.CancelExecutionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [CancelExecution][google.cloud.workflows.executions.v1.Executions.CancelExecution]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.CancelExecutionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.CancelExecutionRequest) + com.google.cloud.workflows.executions.v1.CancelExecutionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest.class, + com.google.cloud.workflows.executions.v1.CancelExecutionRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.CancelExecutionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CancelExecutionRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.CancelExecutionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CancelExecutionRequest build() { + com.google.cloud.workflows.executions.v1.CancelExecutionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CancelExecutionRequest buildPartial() { + com.google.cloud.workflows.executions.v1.CancelExecutionRequest result = + new com.google.cloud.workflows.executions.v1.CancelExecutionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.CancelExecutionRequest) { + return mergeFrom((com.google.cloud.workflows.executions.v1.CancelExecutionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1.CancelExecutionRequest other) { + if (other + == com.google.cloud.workflows.executions.v1.CancelExecutionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.CancelExecutionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.CancelExecutionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.CancelExecutionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.CancelExecutionRequest) + private static final com.google.cloud.workflows.executions.v1.CancelExecutionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.CancelExecutionRequest(); + } + + public static com.google.cloud.workflows.executions.v1.CancelExecutionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CancelExecutionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CancelExecutionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CancelExecutionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CancelExecutionRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CancelExecutionRequestOrBuilder.java new file mode 100644 index 00000000..877a2bd4 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CancelExecutionRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public interface CancelExecutionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.CancelExecutionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CreateExecutionRequest.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CreateExecutionRequest.java new file mode 100644 index 00000000..74f6d3bd --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CreateExecutionRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +/** + * + * + *
+ * Request for the
+ * [CreateExecution][google.cloud.workflows.executions.v1.Executions.CreateExecution]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.CreateExecutionRequest} + */ +public final class CreateExecutionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.CreateExecutionRequest) + CreateExecutionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateExecutionRequest.newBuilder() to construct. + private CreateExecutionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateExecutionRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateExecutionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateExecutionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.workflows.executions.v1.Execution.Builder subBuilder = null; + if (execution_ != null) { + subBuilder = execution_.toBuilder(); + } + execution_ = + input.readMessage( + com.google.cloud.workflows.executions.v1.Execution.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(execution_); + execution_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest.class, + com.google.cloud.workflows.executions.v1.CreateExecutionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXECUTION_FIELD_NUMBER = 2; + private com.google.cloud.workflows.executions.v1.Execution execution_; + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the execution field is set. + */ + @java.lang.Override + public boolean hasExecution() { + return execution_ != null; + } + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The execution. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution getExecution() { + return execution_ == null + ? com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance() + : execution_; + } + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ExecutionOrBuilder getExecutionOrBuilder() { + return getExecution(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (execution_ != null) { + output.writeMessage(2, getExecution()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (execution_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExecution()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.CreateExecutionRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.CreateExecutionRequest other = + (com.google.cloud.workflows.executions.v1.CreateExecutionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasExecution() != other.hasExecution()) return false; + if (hasExecution()) { + if (!getExecution().equals(other.getExecution())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasExecution()) { + hash = (37 * hash) + EXECUTION_FIELD_NUMBER; + hash = (53 * hash) + getExecution().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [CreateExecution][google.cloud.workflows.executions.v1.Executions.CreateExecution]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.CreateExecutionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.CreateExecutionRequest) + com.google.cloud.workflows.executions.v1.CreateExecutionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest.class, + com.google.cloud.workflows.executions.v1.CreateExecutionRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.CreateExecutionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (executionBuilder_ == null) { + execution_ = null; + } else { + execution_ = null; + executionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CreateExecutionRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.CreateExecutionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CreateExecutionRequest build() { + com.google.cloud.workflows.executions.v1.CreateExecutionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CreateExecutionRequest buildPartial() { + com.google.cloud.workflows.executions.v1.CreateExecutionRequest result = + new com.google.cloud.workflows.executions.v1.CreateExecutionRequest(this); + result.parent_ = parent_; + if (executionBuilder_ == null) { + result.execution_ = execution_; + } else { + result.execution_ = executionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.CreateExecutionRequest) { + return mergeFrom((com.google.cloud.workflows.executions.v1.CreateExecutionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1.CreateExecutionRequest other) { + if (other + == com.google.cloud.workflows.executions.v1.CreateExecutionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasExecution()) { + mergeExecution(other.getExecution()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.CreateExecutionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.CreateExecutionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.workflows.executions.v1.Execution execution_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution, + com.google.cloud.workflows.executions.v1.Execution.Builder, + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder> + executionBuilder_; + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the execution field is set. + */ + public boolean hasExecution() { + return executionBuilder_ != null || execution_ != null; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The execution. + */ + public com.google.cloud.workflows.executions.v1.Execution getExecution() { + if (executionBuilder_ == null) { + return execution_ == null + ? com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance() + : execution_; + } else { + return executionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExecution(com.google.cloud.workflows.executions.v1.Execution value) { + if (executionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + execution_ = value; + onChanged(); + } else { + executionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExecution( + com.google.cloud.workflows.executions.v1.Execution.Builder builderForValue) { + if (executionBuilder_ == null) { + execution_ = builderForValue.build(); + onChanged(); + } else { + executionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExecution(com.google.cloud.workflows.executions.v1.Execution value) { + if (executionBuilder_ == null) { + if (execution_ != null) { + execution_ = + com.google.cloud.workflows.executions.v1.Execution.newBuilder(execution_) + .mergeFrom(value) + .buildPartial(); + } else { + execution_ = value; + } + onChanged(); + } else { + executionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExecution() { + if (executionBuilder_ == null) { + execution_ = null; + onChanged(); + } else { + execution_ = null; + executionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.executions.v1.Execution.Builder getExecutionBuilder() { + + onChanged(); + return getExecutionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.executions.v1.ExecutionOrBuilder getExecutionOrBuilder() { + if (executionBuilder_ != null) { + return executionBuilder_.getMessageOrBuilder(); + } else { + return execution_ == null + ? com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance() + : execution_; + } + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution, + com.google.cloud.workflows.executions.v1.Execution.Builder, + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder> + getExecutionFieldBuilder() { + if (executionBuilder_ == null) { + executionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution, + com.google.cloud.workflows.executions.v1.Execution.Builder, + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder>( + getExecution(), getParentForChildren(), isClean()); + execution_ = null; + } + return executionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.CreateExecutionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.CreateExecutionRequest) + private static final com.google.cloud.workflows.executions.v1.CreateExecutionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.CreateExecutionRequest(); + } + + public static com.google.cloud.workflows.executions.v1.CreateExecutionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateExecutionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateExecutionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.CreateExecutionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CreateExecutionRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CreateExecutionRequestOrBuilder.java new file mode 100644 index 00000000..ed2726d9 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/CreateExecutionRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public interface CreateExecutionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.CreateExecutionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the execution field is set. + */ + boolean hasExecution(); + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The execution. + */ + com.google.cloud.workflows.executions.v1.Execution getExecution(); + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder getExecutionOrBuilder(); +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/Execution.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/Execution.java new file mode 100644 index 00000000..2d83128d --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/Execution.java @@ -0,0 +1,3321 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +/** + * + * + *
+ * A running instance of a
+ * [Workflow](/workflows/docs/reference/rest/v1/projects.locations.workflows).
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.Execution} + */ +public final class Execution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.Execution) + ExecutionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Execution.newBuilder() to construct. + private Execution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Execution() { + name_ = ""; + state_ = 0; + argument_ = ""; + result_ = ""; + workflowRevisionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Execution(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Execution( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + argument_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + result_ = s; + break; + } + case 58: + { + com.google.cloud.workflows.executions.v1.Execution.Error.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.cloud.workflows.executions.v1.Execution.Error.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + workflowRevisionId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.Execution.class, + com.google.cloud.workflows.executions.v1.Execution.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of the execution. More states may be added
+   * in the future.
+   * 
+ * + * Protobuf enum {@code google.cloud.workflows.executions.v1.Execution.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The execution is in progress.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The execution finished successfully.
+     * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + /** + * + * + *
+     * The execution failed with an error.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The execution was stopped intentionally.
+     * 
+ * + * CANCELLED = 4; + */ + CANCELLED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The execution is in progress.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The execution finished successfully.
+     * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + /** + * + * + *
+     * The execution failed with an error.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * The execution was stopped intentionally.
+     * 
+ * + * CANCELLED = 4; + */ + public static final int CANCELLED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return SUCCEEDED; + case 3: + return FAILED; + case 4: + return CANCELLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.Execution.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.workflows.executions.v1.Execution.State) + } + + public interface ErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.Execution.Error) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The payload. + */ + java.lang.String getPayload(); + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The bytes for payload. + */ + com.google.protobuf.ByteString getPayloadBytes(); + + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The context. + */ + java.lang.String getContext(); + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + com.google.protobuf.ByteString getContextBytes(); + } + /** + * + * + *
+   * Error describes why the execution was abnormally terminated.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.Execution.Error} + */ + public static final class Error extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.Execution.Error) + ErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Error.newBuilder() to construct. + private Error(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Error() { + payload_ = ""; + context_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Error(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Error( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + payload_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + context_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_Error_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.Execution.Error.class, + com.google.cloud.workflows.executions.v1.Execution.Error.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private volatile java.lang.Object payload_; + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public java.lang.String getPayload() { + java.lang.Object ref = payload_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payload_ = s; + return s; + } + } + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The bytes for payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadBytes() { + java.lang.Object ref = payload_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object context_; + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The context. + */ + @java.lang.Override + public java.lang.String getContext() { + java.lang.Object ref = context_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + context_ = s; + return s; + } + } + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContextBytes() { + java.lang.Object ref = context_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + context_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getPayloadBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, payload_); + } + if (!getContextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, context_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPayloadBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, payload_); + } + if (!getContextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, context_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.Execution.Error)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.Execution.Error other = + (com.google.cloud.workflows.executions.v1.Execution.Error) obj; + + if (!getPayload().equals(other.getPayload())) return false; + if (!getContext().equals(other.getContext())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1.Execution.Error prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Error describes why the execution was abnormally terminated.
+     * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.Execution.Error} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.Execution.Error) + com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_Error_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.Execution.Error.class, + com.google.cloud.workflows.executions.v1.Execution.Error.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.Execution.Error.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + payload_ = ""; + + context_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_Error_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.Error getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.Execution.Error.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.Error build() { + com.google.cloud.workflows.executions.v1.Execution.Error result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.Error buildPartial() { + com.google.cloud.workflows.executions.v1.Execution.Error result = + new com.google.cloud.workflows.executions.v1.Execution.Error(this); + result.payload_ = payload_; + result.context_ = context_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.Execution.Error) { + return mergeFrom((com.google.cloud.workflows.executions.v1.Execution.Error) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.executions.v1.Execution.Error other) { + if (other == com.google.cloud.workflows.executions.v1.Execution.Error.getDefaultInstance()) + return this; + if (!other.getPayload().isEmpty()) { + payload_ = other.payload_; + onChanged(); + } + if (!other.getContext().isEmpty()) { + context_ = other.context_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.Execution.Error parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.Execution.Error) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object payload_ = ""; + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @return The payload. + */ + public java.lang.String getPayload() { + java.lang.Object ref = payload_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payload_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @return The bytes for payload. + */ + public com.google.protobuf.ByteString getPayloadBytes() { + java.lang.Object ref = payload_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + payload_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @param value The bytes for payload to set. + * @return This builder for chaining. + */ + public Builder setPayloadBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + payload_ = value; + onChanged(); + return this; + } + + private java.lang.Object context_ = ""; + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @return The context. + */ + public java.lang.String getContext() { + java.lang.Object ref = context_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + context_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + public com.google.protobuf.ByteString getContextBytes() { + java.lang.Object ref = context_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + context_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @param value The context to set. + * @return This builder for chaining. + */ + public Builder setContext(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + context_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @return This builder for chaining. + */ + public Builder clearContext() { + + context_ = getDefaultInstance().getContext(); + onChanged(); + return this; + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @param value The bytes for context to set. + * @return This builder for chaining. + */ + public Builder setContextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + context_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.Execution.Error) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.Execution.Error) + private static final com.google.cloud.workflows.executions.v1.Execution.Error DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.Execution.Error(); + } + + public static com.google.cloud.workflows.executions.v1.Execution.Error getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Error parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Error(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.Error getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1.Execution.State result = + com.google.cloud.workflows.executions.v1.Execution.State.valueOf(state_); + return result == null + ? com.google.cloud.workflows.executions.v1.Execution.State.UNRECOGNIZED + : result; + } + + public static final int ARGUMENT_FIELD_NUMBER = 5; + private volatile java.lang.Object argument_; + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The argument. + */ + @java.lang.Override + public java.lang.String getArgument() { + java.lang.Object ref = argument_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + argument_ = s; + return s; + } + } + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The bytes for argument. + */ + @java.lang.Override + public com.google.protobuf.ByteString getArgumentBytes() { + java.lang.Object ref = argument_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + argument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESULT_FIELD_NUMBER = 6; + private volatile java.lang.Object result_; + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The result. + */ + @java.lang.Override + public java.lang.String getResult() { + java.lang.Object ref = result_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + result_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for result. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResultBytes() { + java.lang.Object ref = result_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + result_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 7; + private com.google.cloud.workflows.executions.v1.Execution.Error error_; + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.Error getError() { + return error_ == null + ? com.google.cloud.workflows.executions.v1.Execution.Error.getDefaultInstance() + : error_; + } + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder getErrorOrBuilder() { + return getError(); + } + + public static final int WORKFLOW_REVISION_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object workflowRevisionId_; + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workflowRevisionId. + */ + @java.lang.Override + public java.lang.String getWorkflowRevisionId() { + java.lang.Object ref = workflowRevisionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workflowRevisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workflowRevisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkflowRevisionIdBytes() { + java.lang.Object ref = workflowRevisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workflowRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (startTime_ != null) { + output.writeMessage(2, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(3, getEndTime()); + } + if (state_ + != com.google.cloud.workflows.executions.v1.Execution.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!getArgumentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, argument_); + } + if (!getResultBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, result_); + } + if (error_ != null) { + output.writeMessage(7, getError()); + } + if (!getWorkflowRevisionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, workflowRevisionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + if (state_ + != com.google.cloud.workflows.executions.v1.Execution.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getArgumentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, argument_); + } + if (!getResultBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, result_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getError()); + } + if (!getWorkflowRevisionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, workflowRevisionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.Execution)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.Execution other = + (com.google.cloud.workflows.executions.v1.Execution) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (state_ != other.state_) return false; + if (!getArgument().equals(other.getArgument())) return false; + if (!getResult().equals(other.getResult())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!getWorkflowRevisionId().equals(other.getWorkflowRevisionId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ARGUMENT_FIELD_NUMBER; + hash = (53 * hash) + getArgument().hashCode(); + hash = (37 * hash) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + getResult().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + WORKFLOW_REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkflowRevisionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.Execution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.workflows.executions.v1.Execution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A running instance of a
+   * [Workflow](/workflows/docs/reference/rest/v1/projects.locations.workflows).
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.Execution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.Execution) + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.Execution.class, + com.google.cloud.workflows.executions.v1.Execution.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.Execution.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + state_ = 0; + + argument_ = ""; + + result_ = ""; + + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + workflowRevisionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_Execution_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution build() { + com.google.cloud.workflows.executions.v1.Execution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution buildPartial() { + com.google.cloud.workflows.executions.v1.Execution result = + new com.google.cloud.workflows.executions.v1.Execution(this); + result.name_ = name_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.state_ = state_; + result.argument_ = argument_; + result.result_ = result_; + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + result.workflowRevisionId_ = workflowRevisionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.Execution) { + return mergeFrom((com.google.cloud.workflows.executions.v1.Execution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.executions.v1.Execution other) { + if (other == com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getArgument().isEmpty()) { + argument_ = other.argument_; + onChanged(); + } + if (!other.getResult().isEmpty()) { + result_ = other.result_; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (!other.getWorkflowRevisionId().isEmpty()) { + workflowRevisionId_ = other.workflowRevisionId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.Execution parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.Execution) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1.Execution.State result = + com.google.cloud.workflows.executions.v1.Execution.State.valueOf(state_); + return result == null + ? com.google.cloud.workflows.executions.v1.Execution.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.workflows.executions.v1.Execution.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object argument_ = ""; + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @return The argument. + */ + public java.lang.String getArgument() { + java.lang.Object ref = argument_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + argument_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @return The bytes for argument. + */ + public com.google.protobuf.ByteString getArgumentBytes() { + java.lang.Object ref = argument_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + argument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @param value The argument to set. + * @return This builder for chaining. + */ + public Builder setArgument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + argument_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @return This builder for chaining. + */ + public Builder clearArgument() { + + argument_ = getDefaultInstance().getArgument(); + onChanged(); + return this; + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @param value The bytes for argument to set. + * @return This builder for chaining. + */ + public Builder setArgumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + argument_ = value; + onChanged(); + return this; + } + + private java.lang.Object result_ = ""; + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The result. + */ + public java.lang.String getResult() { + java.lang.Object ref = result_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + result_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for result. + */ + public com.google.protobuf.ByteString getResultBytes() { + java.lang.Object ref = result_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + result_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + result_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearResult() { + + result_ = getDefaultInstance().getResult(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for result to set. + * @return This builder for chaining. + */ + public Builder setResultBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + result_ = value; + onChanged(); + return this; + } + + private com.google.cloud.workflows.executions.v1.Execution.Error error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution.Error, + com.google.cloud.workflows.executions.v1.Execution.Error.Builder, + com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder> + errorBuilder_; + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + public com.google.cloud.workflows.executions.v1.Execution.Error getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.workflows.executions.v1.Execution.Error.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError(com.google.cloud.workflows.executions.v1.Execution.Error value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError( + com.google.cloud.workflows.executions.v1.Execution.Error.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeError(com.google.cloud.workflows.executions.v1.Execution.Error value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.cloud.workflows.executions.v1.Execution.Error.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.workflows.executions.v1.Execution.Error.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.workflows.executions.v1.Execution.Error.getDefaultInstance() + : error_; + } + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution.Error, + com.google.cloud.workflows.executions.v1.Execution.Error.Builder, + com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution.Error, + com.google.cloud.workflows.executions.v1.Execution.Error.Builder, + com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private java.lang.Object workflowRevisionId_ = ""; + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workflowRevisionId. + */ + public java.lang.String getWorkflowRevisionId() { + java.lang.Object ref = workflowRevisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workflowRevisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workflowRevisionId. + */ + public com.google.protobuf.ByteString getWorkflowRevisionIdBytes() { + java.lang.Object ref = workflowRevisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workflowRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The workflowRevisionId to set. + * @return This builder for chaining. + */ + public Builder setWorkflowRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workflowRevisionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearWorkflowRevisionId() { + + workflowRevisionId_ = getDefaultInstance().getWorkflowRevisionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for workflowRevisionId to set. + * @return This builder for chaining. + */ + public Builder setWorkflowRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workflowRevisionId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.Execution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.Execution) + private static final com.google.cloud.workflows.executions.v1.Execution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.Execution(); + } + + public static com.google.cloud.workflows.executions.v1.Execution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Execution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Execution(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionName.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionName.java new file mode 100644 index 00000000..3f9edeb0 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionName.java @@ -0,0 +1,261 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ExecutionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_WORKFLOW_EXECUTION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String workflow; + private final String execution; + + @Deprecated + protected ExecutionName() { + project = null; + location = null; + workflow = null; + execution = null; + } + + private ExecutionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workflow = Preconditions.checkNotNull(builder.getWorkflow()); + execution = Preconditions.checkNotNull(builder.getExecution()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkflow() { + return workflow; + } + + public String getExecution() { + return execution; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ExecutionName of( + String project, String location, String workflow, String execution) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkflow(workflow) + .setExecution(execution) + .build(); + } + + public static String format(String project, String location, String workflow, String execution) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkflow(workflow) + .setExecution(execution) + .build() + .toString(); + } + + public static ExecutionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_WORKFLOW_EXECUTION.validatedMatch( + formattedString, "ExecutionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("workflow"), + matchMap.get("execution")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ExecutionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_WORKFLOW_EXECUTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workflow != null) { + fieldMapBuilder.put("workflow", workflow); + } + if (execution != null) { + fieldMapBuilder.put("execution", execution); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_WORKFLOW_EXECUTION.instantiate( + "project", project, "location", location, "workflow", workflow, "execution", execution); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ExecutionName that = ((ExecutionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workflow, that.workflow) + && Objects.equals(this.execution, that.execution); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workflow); + h *= 1000003; + h ^= Objects.hashCode(execution); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}. + */ + public static class Builder { + private String project; + private String location; + private String workflow; + private String execution; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkflow() { + return workflow; + } + + public String getExecution() { + return execution; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkflow(String workflow) { + this.workflow = workflow; + return this; + } + + public Builder setExecution(String execution) { + this.execution = execution; + return this; + } + + private Builder(ExecutionName executionName) { + project = executionName.project; + location = executionName.location; + workflow = executionName.workflow; + execution = executionName.execution; + } + + public ExecutionName build() { + return new ExecutionName(this); + } + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionOrBuilder.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionOrBuilder.java new file mode 100644 index 00000000..741dd27a --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionOrBuilder.java @@ -0,0 +1,285 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public interface ExecutionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.Execution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.workflows.executions.v1.Execution.State getState(); + + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The argument. + */ + java.lang.String getArgument(); + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The bytes for argument. + */ + com.google.protobuf.ByteString getArgumentBytes(); + + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The result. + */ + java.lang.String getResult(); + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for result. + */ + com.google.protobuf.ByteString getResultBytes(); + + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + boolean hasError(); + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + com.google.cloud.workflows.executions.v1.Execution.Error getError(); + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.workflows.executions.v1.Execution.ErrorOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workflowRevisionId. + */ + java.lang.String getWorkflowRevisionId(); + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workflowRevisionId. + */ + com.google.protobuf.ByteString getWorkflowRevisionIdBytes(); +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionView.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionView.java new file mode 100644 index 00000000..a85f1bd6 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionView.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +/** + * + * + *
+ * Defines possible views for execution resource.
+ * 
+ * + * Protobuf enum {@code google.cloud.workflows.executions.v1.ExecutionView} + */ +public enum ExecutionView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default / unset value.
+   * 
+ * + * EXECUTION_VIEW_UNSPECIFIED = 0; + */ + EXECUTION_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Includes only basic metadata about the execution.
+   * Following fields are returned: name, start_time, end_time, state
+   * and workflow_revision_id.
+   * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + * + * + *
+   * Includes all data.
+   * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default / unset value.
+   * 
+ * + * EXECUTION_VIEW_UNSPECIFIED = 0; + */ + public static final int EXECUTION_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Includes only basic metadata about the execution.
+   * Following fields are returned: name, start_time, end_time, state
+   * and workflow_revision_id.
+   * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + /** + * + * + *
+   * Includes all data.
+   * 
+ * + * FULL = 2; + */ + public static final int FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExecutionView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ExecutionView forNumber(int value) { + switch (value) { + case 0: + return EXECUTION_VIEW_UNSPECIFIED; + case 1: + return BASIC; + case 2: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExecutionView findValueByNumber(int number) { + return ExecutionView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ExecutionView[] VALUES = values(); + + public static ExecutionView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ExecutionView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.workflows.executions.v1.ExecutionView) +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsProto.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsProto.java new file mode 100644 index 00000000..c9e32bbc --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ExecutionsProto.java @@ -0,0 +1,236 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public final class ExecutionsProto { + private ExecutionsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_Execution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_Execution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_Execution_Error_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_Execution_Error_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_CreateExecutionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1_CancelExecutionRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n5google/cloud/workflows/executions/v1/e" + + "xecutions.proto\022$google.cloud.workflows." + + "executions.v1\032\034google/api/annotations.pr" + + "oto\032\027google/api/client.proto\032\037google/api" + + "/field_behavior.proto\032\031google/api/resour" + + "ce.proto\032\037google/protobuf/timestamp.prot" + + "o\"\360\004\n\tExecution\022\021\n\004name\030\001 \001(\tB\003\340A\003\0223\n\nst" + + "art_time\030\002 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\0221\n\010end_time\030\003 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\003\022I\n\005state\030\004 \001(\01625.goog" + + "le.cloud.workflows.executions.v1.Executi" + + "on.StateB\003\340A\003\022\020\n\010argument\030\005 \001(\t\022\023\n\006resul" + + "t\030\006 \001(\tB\003\340A\003\022I\n\005error\030\007 \001(\01325.google.clo" + + "ud.workflows.executions.v1.Execution.Err" + + "orB\003\340A\003\022!\n\024workflow_revision_id\030\010 \001(\tB\003\340" + + "A\003\032)\n\005Error\022\017\n\007payload\030\001 \001(\t\022\017\n\007context\030" + + "\002 \001(\t\"T\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n" + + "\006ACTIVE\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\r\n\t" + + "CANCELLED\020\004:\206\001\352A\202\001\n+workflowexecutions.g" + + "oogleapis.com/Execution\022Sprojects/{proje" + + "ct}/locations/{location}/workflows/{work" + + "flow}/executions/{execution}\"\301\001\n\025ListExe" + + "cutionsRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!" + + "workflows.googleapis.com/Workflow\022\021\n\tpag" + + "e_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022F\n\004view" + + "\030\004 \001(\01623.google.cloud.workflows.executio" + + "ns.v1.ExecutionViewB\003\340A\001\"v\n\026ListExecutio" + + "nsResponse\022C\n\nexecutions\030\001 \003(\0132/.google." + + "cloud.workflows.executions.v1.Execution\022" + + "\027\n\017next_page_token\030\002 \001(\t\"\234\001\n\026CreateExecu" + + "tionRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!wor" + + "kflows.googleapis.com/Workflow\022G\n\texecut" + + "ion\030\002 \001(\0132/.google.cloud.workflows.execu" + + "tions.v1.ExecutionB\003\340A\002\"\240\001\n\023GetExecution" + + "Request\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+workflowe" + + "xecutions.googleapis.com/Execution\022F\n\004vi" + + "ew\030\002 \001(\01623.google.cloud.workflows.execut" + + "ions.v1.ExecutionViewB\003\340A\001\"[\n\026CancelExec" + + "utionRequest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+work" + + "flowexecutions.googleapis.com/Execution*" + + "D\n\rExecutionView\022\036\n\032EXECUTION_VIEW_UNSPE" + + "CIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\0022\303\007\n\nExecut" + + "ions\022\330\001\n\016ListExecutions\022;.google.cloud.w" + + "orkflows.executions.v1.ListExecutionsReq" + + "uest\032<.google.cloud.workflows.executions" + + ".v1.ListExecutionsResponse\"K\202\323\344\223\002<\022:/v1/" + + "{parent=projects/*/locations/*/workflows" + + "/*}/executions\332A\006parent\022\342\001\n\017CreateExecut" + + "ion\022<.google.cloud.workflows.executions." + + "v1.CreateExecutionRequest\032/.google.cloud" + + ".workflows.executions.v1.Execution\"`\202\323\344\223" + + "\002G\":/v1/{parent=projects/*/locations/*/w" + + "orkflows/*}/executions:\texecution\332A\020pare" + + "nt,execution\022\305\001\n\014GetExecution\0229.google.c" + + "loud.workflows.executions.v1.GetExecutio" + + "nRequest\032/.google.cloud.workflows.execut" + + "ions.v1.Execution\"I\202\323\344\223\002<\022:/v1/{name=pro" + + "jects/*/locations/*/workflows/*/executio" + + "ns/*}\332A\004name\022\325\001\n\017CancelExecution\022<.googl" + + "e.cloud.workflows.executions.v1.CancelEx" + + "ecutionRequest\032/.google.cloud.workflows." + + "executions.v1.Execution\"S\202\323\344\223\002F\"A/v1/{na" + + "me=projects/*/locations/*/workflows/*/ex" + + "ecutions/*}:cancel:\001*\332A\004name\032U\312A!workflo" + + "wexecutions.googleapis.com\322A.https://www" + + ".googleapis.com/auth/cloud-platformB\361\001\n(" + + "com.google.cloud.workflows.executions.v1" + + "B\017ExecutionsProtoP\001ZNgoogle.golang.org/g" + + "enproto/googleapis/cloud/workflows/execu" + + "tions/v1;executions\352Aa\n!workflows.google" + + "apis.com/Workflow\022 + * Request for the + * [GetExecution][google.cloud.workflows.executions.v1.Executions.GetExecution] + * method. + * + * + * Protobuf type {@code google.cloud.workflows.executions.v1.GetExecutionRequest} + */ +public final class GetExecutionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.GetExecutionRequest) + GetExecutionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetExecutionRequest.newBuilder() to construct. + private GetExecutionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetExecutionRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetExecutionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetExecutionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.GetExecutionRequest.class, + com.google.cloud.workflows.executions.v1.GetExecutionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1.ExecutionView result = + com.google.cloud.workflows.executions.v1.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1.ExecutionView.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (view_ + != com.google.cloud.workflows.executions.v1.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (view_ + != com.google.cloud.workflows.executions.v1.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.GetExecutionRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.GetExecutionRequest other = + (com.google.cloud.workflows.executions.v1.GetExecutionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1.GetExecutionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [GetExecution][google.cloud.workflows.executions.v1.Executions.GetExecution]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.GetExecutionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.GetExecutionRequest) + com.google.cloud.workflows.executions.v1.GetExecutionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.GetExecutionRequest.class, + com.google.cloud.workflows.executions.v1.GetExecutionRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.GetExecutionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_GetExecutionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.GetExecutionRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.GetExecutionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.GetExecutionRequest build() { + com.google.cloud.workflows.executions.v1.GetExecutionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.GetExecutionRequest buildPartial() { + com.google.cloud.workflows.executions.v1.GetExecutionRequest result = + new com.google.cloud.workflows.executions.v1.GetExecutionRequest(this); + result.name_ = name_; + result.view_ = view_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.GetExecutionRequest) { + return mergeFrom((com.google.cloud.workflows.executions.v1.GetExecutionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.executions.v1.GetExecutionRequest other) { + if (other + == com.google.cloud.workflows.executions.v1.GetExecutionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.GetExecutionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.GetExecutionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1.ExecutionView result = + com.google.cloud.workflows.executions.v1.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1.ExecutionView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.workflows.executions.v1.ExecutionView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.GetExecutionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.GetExecutionRequest) + private static final com.google.cloud.workflows.executions.v1.GetExecutionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.GetExecutionRequest(); + } + + public static com.google.cloud.workflows.executions.v1.GetExecutionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetExecutionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetExecutionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.GetExecutionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/GetExecutionRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/GetExecutionRequestOrBuilder.java new file mode 100644 index 00000000..23c574a0 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/GetExecutionRequestOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public interface GetExecutionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.GetExecutionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.workflows.executions.v1.ExecutionView getView(); +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsRequest.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsRequest.java new file mode 100644 index 00000000..5020e166 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsRequest.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +/** + * + * + *
+ * Request for the
+ * [ListExecutions][]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.ListExecutionsRequest} + */ +public final class ListExecutionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.ListExecutionsRequest) + ListExecutionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListExecutionsRequest.newBuilder() to construct. + private ListExecutionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExecutionsRequest() { + parent_ = ""; + pageToken_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExecutionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListExecutionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest.class, + com.google.cloud.workflows.executions.v1.ListExecutionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of executions to return per call.
+   * Max supported value depends on the selected Execution view: it's 10000 for
+   * BASIC and 100 for FULL. The default value used if the field is not
+   * specified is 100, regardless of the selected view. Values greater than
+   * the max value will be coerced down to it.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 4; + private int view_; + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1.ExecutionView result = + com.google.cloud.workflows.executions.v1.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1.ExecutionView.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (view_ + != com.google.cloud.workflows.executions.v1.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (view_ + != com.google.cloud.workflows.executions.v1.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, view_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.ListExecutionsRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.ListExecutionsRequest other = + (com.google.cloud.workflows.executions.v1.ListExecutionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (view_ != other.view_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [ListExecutions][]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.ListExecutionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.ListExecutionsRequest) + com.google.cloud.workflows.executions.v1.ListExecutionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.ListExecutionsRequest.class, + com.google.cloud.workflows.executions.v1.ListExecutionsRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.ListExecutionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.ListExecutionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsRequest build() { + com.google.cloud.workflows.executions.v1.ListExecutionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsRequest buildPartial() { + com.google.cloud.workflows.executions.v1.ListExecutionsRequest result = + new com.google.cloud.workflows.executions.v1.ListExecutionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.view_ = view_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.ListExecutionsRequest) { + return mergeFrom((com.google.cloud.workflows.executions.v1.ListExecutionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.executions.v1.ListExecutionsRequest other) { + if (other + == com.google.cloud.workflows.executions.v1.ListExecutionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.ListExecutionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.ListExecutionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of executions to return per call.
+     * Max supported value depends on the selected Execution view: it's 10000 for
+     * BASIC and 100 for FULL. The default value used if the field is not
+     * specified is 100, regardless of the selected view. Values greater than
+     * the max value will be coerced down to it.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of executions to return per call.
+     * Max supported value depends on the selected Execution view: it's 10000 for
+     * BASIC and 100 for FULL. The default value used if the field is not
+     * specified is 100, regardless of the selected view. Values greater than
+     * the max value will be coerced down to it.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of executions to return per call.
+     * Max supported value depends on the selected Execution view: it's 10000 for
+     * BASIC and 100 for FULL. The default value used if the field is not
+     * specified is 100, regardless of the selected view. Values greater than
+     * the max value will be coerced down to it.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1.ExecutionView result = + com.google.cloud.workflows.executions.v1.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1.ExecutionView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.workflows.executions.v1.ExecutionView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.ListExecutionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.ListExecutionsRequest) + private static final com.google.cloud.workflows.executions.v1.ListExecutionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.ListExecutionsRequest(); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExecutionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListExecutionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsRequestOrBuilder.java new file mode 100644 index 00000000..bfc5dc1a --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public interface ListExecutionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.ListExecutionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of executions to return per call.
+   * Max supported value depends on the selected Execution view: it's 10000 for
+   * BASIC and 100 for FULL. The default value used if the field is not
+   * specified is 100, regardless of the selected view. Values greater than
+   * the max value will be coerced down to it.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.workflows.executions.v1.ExecutionView getView(); +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsResponse.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsResponse.java new file mode 100644 index 00000000..ce1861a9 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsResponse.java @@ -0,0 +1,1159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +/** + * + * + *
+ * Response for the
+ * [ListExecutions][google.cloud.workflows.executions.v1.Executions.ListExecutions]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.ListExecutionsResponse} + */ +public final class ListExecutionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1.ListExecutionsResponse) + ListExecutionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListExecutionsResponse.newBuilder() to construct. + private ListExecutionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExecutionsResponse() { + executions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExecutionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListExecutionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + executions_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + executions_.add( + input.readMessage( + com.google.cloud.workflows.executions.v1.Execution.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + executions_ = java.util.Collections.unmodifiableList(executions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.ListExecutionsResponse.class, + com.google.cloud.workflows.executions.v1.ListExecutionsResponse.Builder.class); + } + + public static final int EXECUTIONS_FIELD_NUMBER = 1; + private java.util.List executions_; + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + @java.lang.Override + public java.util.List getExecutionsList() { + return executions_; + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + @java.lang.Override + public java.util.List + getExecutionsOrBuilderList() { + return executions_; + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + @java.lang.Override + public int getExecutionsCount() { + return executions_.size(); + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.Execution getExecutions(int index) { + return executions_.get(index); + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ExecutionOrBuilder getExecutionsOrBuilder( + int index) { + return executions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < executions_.size(); i++) { + output.writeMessage(1, executions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < executions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, executions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1.ListExecutionsResponse)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1.ListExecutionsResponse other = + (com.google.cloud.workflows.executions.v1.ListExecutionsResponse) obj; + + if (!getExecutionsList().equals(other.getExecutionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExecutionsCount() > 0) { + hash = (37 * hash) + EXECUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExecutionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1.ListExecutionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the
+   * [ListExecutions][google.cloud.workflows.executions.v1.Executions.ListExecutions]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1.ListExecutionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1.ListExecutionsResponse) + com.google.cloud.workflows.executions.v1.ListExecutionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1.ListExecutionsResponse.class, + com.google.cloud.workflows.executions.v1.ListExecutionsResponse.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1.ListExecutionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExecutionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (executionsBuilder_ == null) { + executions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + executionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1_ListExecutionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsResponse + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1.ListExecutionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsResponse build() { + com.google.cloud.workflows.executions.v1.ListExecutionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsResponse buildPartial() { + com.google.cloud.workflows.executions.v1.ListExecutionsResponse result = + new com.google.cloud.workflows.executions.v1.ListExecutionsResponse(this); + int from_bitField0_ = bitField0_; + if (executionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + executions_ = java.util.Collections.unmodifiableList(executions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.executions_ = executions_; + } else { + result.executions_ = executionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1.ListExecutionsResponse) { + return mergeFrom((com.google.cloud.workflows.executions.v1.ListExecutionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1.ListExecutionsResponse other) { + if (other + == com.google.cloud.workflows.executions.v1.ListExecutionsResponse.getDefaultInstance()) + return this; + if (executionsBuilder_ == null) { + if (!other.executions_.isEmpty()) { + if (executions_.isEmpty()) { + executions_ = other.executions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExecutionsIsMutable(); + executions_.addAll(other.executions_); + } + onChanged(); + } + } else { + if (!other.executions_.isEmpty()) { + if (executionsBuilder_.isEmpty()) { + executionsBuilder_.dispose(); + executionsBuilder_ = null; + executions_ = other.executions_; + bitField0_ = (bitField0_ & ~0x00000001); + executionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExecutionsFieldBuilder() + : null; + } else { + executionsBuilder_.addAllMessages(other.executions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1.ListExecutionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1.ListExecutionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List executions_ = + java.util.Collections.emptyList(); + + private void ensureExecutionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + executions_ = + new java.util.ArrayList( + executions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution, + com.google.cloud.workflows.executions.v1.Execution.Builder, + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder> + executionsBuilder_; + + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public java.util.List getExecutionsList() { + if (executionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(executions_); + } else { + return executionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public int getExecutionsCount() { + if (executionsBuilder_ == null) { + return executions_.size(); + } else { + return executionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1.Execution getExecutions(int index) { + if (executionsBuilder_ == null) { + return executions_.get(index); + } else { + return executionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder setExecutions( + int index, com.google.cloud.workflows.executions.v1.Execution value) { + if (executionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExecutionsIsMutable(); + executions_.set(index, value); + onChanged(); + } else { + executionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder setExecutions( + int index, com.google.cloud.workflows.executions.v1.Execution.Builder builderForValue) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.set(index, builderForValue.build()); + onChanged(); + } else { + executionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder addExecutions(com.google.cloud.workflows.executions.v1.Execution value) { + if (executionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExecutionsIsMutable(); + executions_.add(value); + onChanged(); + } else { + executionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder addExecutions( + int index, com.google.cloud.workflows.executions.v1.Execution value) { + if (executionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExecutionsIsMutable(); + executions_.add(index, value); + onChanged(); + } else { + executionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder addExecutions( + com.google.cloud.workflows.executions.v1.Execution.Builder builderForValue) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.add(builderForValue.build()); + onChanged(); + } else { + executionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder addExecutions( + int index, com.google.cloud.workflows.executions.v1.Execution.Builder builderForValue) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.add(index, builderForValue.build()); + onChanged(); + } else { + executionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder addAllExecutions( + java.lang.Iterable values) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, executions_); + onChanged(); + } else { + executionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder clearExecutions() { + if (executionsBuilder_ == null) { + executions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + executionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public Builder removeExecutions(int index) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.remove(index); + onChanged(); + } else { + executionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1.Execution.Builder getExecutionsBuilder( + int index) { + return getExecutionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1.ExecutionOrBuilder getExecutionsOrBuilder( + int index) { + if (executionsBuilder_ == null) { + return executions_.get(index); + } else { + return executionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public java.util.List + getExecutionsOrBuilderList() { + if (executionsBuilder_ != null) { + return executionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(executions_); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1.Execution.Builder addExecutionsBuilder() { + return getExecutionsFieldBuilder() + .addBuilder(com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance()); + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1.Execution.Builder addExecutionsBuilder( + int index) { + return getExecutionsFieldBuilder() + .addBuilder( + index, com.google.cloud.workflows.executions.v1.Execution.getDefaultInstance()); + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + public java.util.List + getExecutionsBuilderList() { + return getExecutionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution, + com.google.cloud.workflows.executions.v1.Execution.Builder, + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder> + getExecutionsFieldBuilder() { + if (executionsBuilder_ == null) { + executionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.executions.v1.Execution, + com.google.cloud.workflows.executions.v1.Execution.Builder, + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder>( + executions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + executions_ = null; + } + return executionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1.ListExecutionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1.ListExecutionsResponse) + private static final com.google.cloud.workflows.executions.v1.ListExecutionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1.ListExecutionsResponse(); + } + + public static com.google.cloud.workflows.executions.v1.ListExecutionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExecutionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListExecutionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1.ListExecutionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsResponseOrBuilder.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsResponseOrBuilder.java new file mode 100644 index 00000000..8283508a --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/ListExecutionsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1/executions.proto + +package com.google.cloud.workflows.executions.v1; + +public interface ListExecutionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1.ListExecutionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + java.util.List getExecutionsList(); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + com.google.cloud.workflows.executions.v1.Execution getExecutions(int index); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + int getExecutionsCount(); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + java.util.List + getExecutionsOrBuilderList(); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1.Execution executions = 1; + */ + com.google.cloud.workflows.executions.v1.ExecutionOrBuilder getExecutionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/WorkflowName.java b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/WorkflowName.java new file mode 100644 index 00000000..e204439d --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/java/com/google/cloud/workflows/executions/v1/WorkflowName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class WorkflowName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_WORKFLOW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workflows/{workflow}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String workflow; + + @Deprecated + protected WorkflowName() { + project = null; + location = null; + workflow = null; + } + + private WorkflowName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workflow = Preconditions.checkNotNull(builder.getWorkflow()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkflow() { + return workflow; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static WorkflowName of(String project, String location, String workflow) { + return newBuilder().setProject(project).setLocation(location).setWorkflow(workflow).build(); + } + + public static String format(String project, String location, String workflow) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkflow(workflow) + .build() + .toString(); + } + + public static WorkflowName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_WORKFLOW.validatedMatch( + formattedString, "WorkflowName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("workflow")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (WorkflowName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_WORKFLOW.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workflow != null) { + fieldMapBuilder.put("workflow", workflow); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_WORKFLOW.instantiate( + "project", project, "location", location, "workflow", workflow); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WorkflowName that = ((WorkflowName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workflow, that.workflow); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workflow); + return h; + } + + /** Builder for projects/{project}/locations/{location}/workflows/{workflow}. */ + public static class Builder { + private String project; + private String location; + private String workflow; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkflow() { + return workflow; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkflow(String workflow) { + this.workflow = workflow; + return this; + } + + private Builder(WorkflowName workflowName) { + project = workflowName.project; + location = workflowName.location; + workflow = workflowName.workflow; + } + + public WorkflowName build() { + return new WorkflowName(this); + } + } +} diff --git a/proto-google-cloud-workflow-executions-v1/src/main/proto/google/cloud/workflows/executions/v1/executions.proto b/proto-google-cloud-workflow-executions-v1/src/main/proto/google/cloud/workflows/executions/v1/executions.proto new file mode 100644 index 00000000..583a5d90 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1/src/main/proto/google/cloud/workflows/executions/v1/executions.proto @@ -0,0 +1,253 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.workflows.executions.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1;executions"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionsProto"; +option java_package = "com.google.cloud.workflows.executions.v1"; +option (google.api.resource_definition) = { + type: "workflows.googleapis.com/Workflow" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}" +}; + +// Executions is used to start and manage running instances of +// [Workflows][google.cloud.workflows.v1.Workflow] called executions. +service Executions { + option (google.api.default_host) = "workflowexecutions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of executions which belong to the workflow with + // the given name. The method returns executions of all workflow + // revisions. Returned executions are ordered by their start time (newest + // first). + rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/workflows/*}/executions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new execution using the latest revision of the given workflow. + rpc CreateExecution(CreateExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/workflows/*}/executions" + body: "execution" + }; + option (google.api.method_signature) = "parent,execution"; + } + + // Returns an execution of the given name. + rpc GetExecution(GetExecutionRequest) returns (Execution) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workflows/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancels an execution of the given name. + rpc CancelExecution(CancelExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// A running instance of a +// [Workflow](/workflows/docs/reference/rest/v1/projects.locations.workflows). +message Execution { + option (google.api.resource) = { + type: "workflowexecutions.googleapis.com/Execution" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}" + }; + + // Error describes why the execution was abnormally terminated. + message Error { + // Error payload returned by the execution, represented as a JSON string. + string payload = 1; + + // Human readable error context, helpful for debugging purposes. + string context = 2; + } + + // Describes the current state of the execution. More states may be added + // in the future. + enum State { + // Invalid state. + STATE_UNSPECIFIED = 0; + + // The execution is in progress. + ACTIVE = 1; + + // The execution finished successfully. + SUCCEEDED = 2; + + // The execution failed with an error. + FAILED = 3; + + // The execution was stopped intentionally. + CANCELLED = 4; + } + + // Output only. The resource name of the execution. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Marks the beginning of execution. + google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Marks the end of execution, successful or not. + google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the execution. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input parameters of the execution represented as a JSON string. + // The size limit is 32KB. + string argument = 5; + + // Output only. Output of the execution represented as a JSON string. The + // value can only be present if the execution's state is `SUCCEEDED`. + string result = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error which caused the execution to finish prematurely. + // The value is only present if the execution's state is `FAILED` + // or `CANCELLED`. + Error error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision of the workflow this execution is using. + string workflow_revision_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for the +// [ListExecutions][] +// method. +message ListExecutionsRequest { + // Required. Name of the workflow for which the executions should be listed. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; + + // Maximum number of executions to return per call. + // Max supported value depends on the selected Execution view: it's 10000 for + // BASIC and 100 for FULL. The default value used if the field is not + // specified is 100, regardless of the selected view. Values greater than + // the max value will be coerced down to it. + int32 page_size = 2; + + // A page token, received from a previous `ListExecutions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListExecutions` must + // match the call that provided the page token. + string page_token = 3; + + // Optional. A view defining which fields should be filled in the returned executions. + // The API will default to the BASIC view. + ExecutionView view = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the +// [ListExecutions][google.cloud.workflows.executions.v1.Executions.ListExecutions] +// method. +message ListExecutionsResponse { + // The executions which match the request. + repeated Execution executions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request for the +// [CreateExecution][google.cloud.workflows.executions.v1.Executions.CreateExecution] +// method. +message CreateExecutionRequest { + // Required. Name of the workflow for which an execution should be created. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + // The latest revision of the workflow will be used. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; + + // Required. Execution to be created. + Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the +// [GetExecution][google.cloud.workflows.executions.v1.Executions.GetExecution] +// method. +message GetExecutionRequest { + // Required. Name of the execution to be retrieved. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflowexecutions.googleapis.com/Execution" + } + ]; + + // Optional. A view defining which fields should be filled in the returned execution. + // The API will default to the FULL view. + ExecutionView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the +// [CancelExecution][google.cloud.workflows.executions.v1.Executions.CancelExecution] +// method. +message CancelExecutionRequest { + // Required. Name of the execution to be cancelled. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflowexecutions.googleapis.com/Execution" + } + ]; +} + +// Defines possible views for execution resource. +enum ExecutionView { + // The default / unset value. + EXECUTION_VIEW_UNSPECIFIED = 0; + + // Includes only basic metadata about the execution. + // Following fields are returned: name, start_time, end_time, state + // and workflow_revision_id. + BASIC = 1; + + // Includes all data. + FULL = 2; +} diff --git a/proto-google-cloud-workflow-executions-v1beta/clirr-ignored-differences.xml b/proto-google-cloud-workflow-executions-v1beta/clirr-ignored-differences.xml new file mode 100644 index 00000000..15e0e3fd --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/workflows/executions/v1beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/workflows/executions/v1beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/workflows/executions/v1beta/*OrBuilder + boolean has*(*) + + diff --git a/synth.metadata b/synth.metadata index b9c64ce5..876a388e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,23 +3,29 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/java-workflow-executions.git", - "sha": "0818bcb48006e55a81ddfe244fc5444174f632ef" + "remote": "git@github.com:googleapis/java-workflow-executions.git", + "sha": "063ce4b860f5493e69358668e2ee2abfd061c805" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", - "internalRef": "362856902" + "sha": "ed6d0d5d05d75ba5800ed56a2bca924a1b8ec317" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "ed6d0d5d05d75ba5800ed56a2bca924a1b8ec317" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8eae0234a16b26c2ff616d305dbd9786c8b10a47" + "sha": "1778de119522ea9c9b18763c2a4577e22a60433c" } } ], @@ -32,111 +38,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "workflows-executions", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } } - ], - "generatedFiles": [ - ".github/CODEOWNERS", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/blunderbuss.yml", - ".github/generated-files-bot.yml", - ".github/readme/synth.py", - ".github/release-please.yml", - ".github/snippet-bot.yml", - ".github/sync-repo-settings.yaml", - ".github/trusted-contribution.yml", - ".github/workflows/approve-readme.yaml", - ".github/workflows/auto-release.yaml", - ".github/workflows/ci.yaml", - ".github/workflows/samples.yaml", - ".kokoro/build.bat", - ".kokoro/build.sh", - ".kokoro/coerce_logs.sh", - ".kokoro/common.cfg", - ".kokoro/common.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/java8.cfg", - ".kokoro/continuous/readme.cfg", - ".kokoro/dependencies.sh", - ".kokoro/nightly/common.cfg", - ".kokoro/nightly/integration.cfg", - ".kokoro/nightly/java11.cfg", - ".kokoro/nightly/java7.cfg", - ".kokoro/nightly/java8-osx.cfg", - ".kokoro/nightly/java8-win.cfg", - ".kokoro/nightly/java8.cfg", - ".kokoro/nightly/samples.cfg", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/clirr.cfg", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/dependencies.cfg", - ".kokoro/presubmit/integration.cfg", - ".kokoro/presubmit/java11.cfg", - ".kokoro/presubmit/java7.cfg", - ".kokoro/presubmit/java8-osx.cfg", - ".kokoro/presubmit/java8-win.cfg", - ".kokoro/presubmit/java8.cfg", - ".kokoro/presubmit/linkage-monitor.cfg", - ".kokoro/presubmit/lint.cfg", - ".kokoro/presubmit/samples.cfg", - ".kokoro/readme.sh", - ".kokoro/release/bump_snapshot.cfg", - ".kokoro/release/common.cfg", - ".kokoro/release/common.sh", - ".kokoro/release/drop.cfg", - ".kokoro/release/drop.sh", - ".kokoro/release/promote.cfg", - ".kokoro/release/promote.sh", - ".kokoro/release/publish_javadoc.cfg", - ".kokoro/release/publish_javadoc.sh", - ".kokoro/release/publish_javadoc11.cfg", - ".kokoro/release/publish_javadoc11.sh", - ".kokoro/release/snapshot.cfg", - ".kokoro/release/snapshot.sh", - ".kokoro/release/stage.cfg", - ".kokoro/release/stage.sh", - ".kokoro/trampoline.sh", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "codecov.yaml", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClient.java", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsSettings.java", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/gapic_metadata.json", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/package-info.java", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStub.java", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStubSettings.java", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsCallableFactory.java", - "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsStub.java", - "google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClientTest.java", - "google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutions.java", - "google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutionsImpl.java", - "grpc-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsGrpc.java", - "java.header", - "license-checks.xml", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequest.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequestOrBuilder.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequest.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequestOrBuilder.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/Execution.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionName.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionOrBuilder.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionView.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsProto.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequest.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequestOrBuilder.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequest.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequestOrBuilder.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponse.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponseOrBuilder.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/WorkflowName.java", - "proto-google-cloud-workflow-executions-v1beta/src/main/proto/google/cloud/workflows/executions/v1beta/executions.proto", - "renovate.json", - "samples/install-without-bom/pom.xml", - "samples/pom.xml", - "samples/snapshot/pom.xml", - "samples/snippets/pom.xml" ] } \ No newline at end of file diff --git a/synth.py b/synth.py index 14cb3c23..09aff63b 100644 --- a/synth.py +++ b/synth.py @@ -19,7 +19,7 @@ import synthtool.languages.java as java service = 'workflows-executions' -versions = ['v1beta'] +versions = ['v1beta','v1'] for version in versions: java.bazel_library( diff --git a/versions.txt b/versions.txt index f32f38ef..fdba37f0 100644 --- a/versions.txt +++ b/versions.txt @@ -2,5 +2,7 @@ # module:released-version:current-version google-cloud-workflow-executions:0.1.8:0.1.9-SNAPSHOT +grpc-google-cloud-workflow-executions-v1beta:0.1.8:0.1.9-SNAPSHOT +grpc-google-cloud-workflow-executions-v1:0.1.8:0.1.9-SNAPSHOT proto-google-cloud-workflow-executions-v1beta:0.1.8:0.1.9-SNAPSHOT -grpc-google-cloud-workflow-executions-v1beta:0.1.8:0.1.9-SNAPSHOT \ No newline at end of file +proto-google-cloud-workflow-executions-v1:0.1.8:0.1.9-SNAPSHOT