From 19de824759b9bf2fe9856180f0112b76df44c1d1 Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 29 Apr 2021 15:00:08 -0400 Subject: [PATCH] feat: v1 client generation (#240) --- java-workflows/.github/.OwlBot.lock.yaml | 3 + java-workflows/.github/.OwlBot.yaml | 29 + .../google-cloud-workflows-bom/pom.xml | 19 +- java-workflows/google-cloud-workflows/pom.xml | 13 +- .../cloud/workflows/v1/WorkflowsClient.java | 905 +++++ .../cloud/workflows/v1/WorkflowsSettings.java | 265 ++ .../cloud/workflows/v1/gapic_metadata.json | 33 + .../cloud/workflows/v1/package-info.java | 37 + .../v1/stub/GrpcWorkflowsCallableFactory.java | 113 + .../workflows/v1/stub/GrpcWorkflowsStub.java | 349 ++ .../workflows/v1/stub/WorkflowsStub.java | 92 + .../v1/stub/WorkflowsStubSettings.java | 562 +++ .../cloud/workflows/v1/MockWorkflows.java | 59 + .../cloud/workflows/v1/MockWorkflowsImpl.java | 165 + .../workflows/v1/WorkflowsClientTest.java | 524 +++ .../grpc-google-cloud-workflows-v1/pom.xml | 69 + .../cloud/workflows/v1/WorkflowsGrpc.java | 851 +++++ java-workflows/owlbot.py | 24 + java-workflows/pom.xml | 16 +- .../clirr-ignored-differences.xml | 19 + .../proto-google-cloud-workflows-v1/pom.xml | 42 + .../workflows/v1/CreateWorkflowRequest.java | 1183 ++++++ .../v1/CreateWorkflowRequestOrBuilder.java | 134 + .../workflows/v1/DeleteWorkflowRequest.java | 661 ++++ .../v1/DeleteWorkflowRequestOrBuilder.java | 56 + .../workflows/v1/GetWorkflowRequest.java | 658 ++++ .../v1/GetWorkflowRequestOrBuilder.java | 56 + .../workflows/v1/ListWorkflowsRequest.java | 1342 +++++++ .../v1/ListWorkflowsRequestOrBuilder.java | 159 + .../workflows/v1/ListWorkflowsResponse.java | 1415 ++++++++ .../v1/ListWorkflowsResponseOrBuilder.java | 155 + .../cloud/workflows/v1/LocationName.java | 192 + .../cloud/workflows/v1/OperationMetadata.java | 1533 ++++++++ .../v1/OperationMetadataOrBuilder.java | 170 + .../workflows/v1/UpdateWorkflowRequest.java | 1045 ++++++ .../v1/UpdateWorkflowRequestOrBuilder.java | 104 + .../google/cloud/workflows/v1/Workflow.java | 3172 +++++++++++++++++ .../cloud/workflows/v1/WorkflowName.java | 223 ++ .../cloud/workflows/v1/WorkflowOrBuilder.java | 423 +++ .../cloud/workflows/v1/WorkflowsProto.java | 269 ++ .../google/cloud/workflows/v1/workflows.proto | 314 ++ java-workflows/synth.py | 32 - java-workflows/versions.txt | 4 +- 43 files changed, 17447 insertions(+), 42 deletions(-) create mode 100644 java-workflows/.github/.OwlBot.lock.yaml create mode 100644 java-workflows/.github/.OwlBot.yaml create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsClient.java create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsSettings.java create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/gapic_metadata.json create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/package-info.java create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsCallableFactory.java create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsStub.java create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStub.java create mode 100644 java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java create mode 100644 java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflows.java create mode 100644 java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflowsImpl.java create mode 100644 java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/WorkflowsClientTest.java create mode 100644 java-workflows/grpc-google-cloud-workflows-v1/pom.xml create mode 100644 java-workflows/grpc-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsGrpc.java create mode 100644 java-workflows/owlbot.py create mode 100644 java-workflows/proto-google-cloud-workflows-v1/clirr-ignored-differences.xml create mode 100644 java-workflows/proto-google-cloud-workflows-v1/pom.xml create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequest.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequestOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequest.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequestOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequest.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequestOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequest.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequestOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponse.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponseOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/LocationName.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadata.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadataOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequest.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequestOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/Workflow.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowName.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowOrBuilder.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsProto.java create mode 100644 java-workflows/proto-google-cloud-workflows-v1/src/main/proto/google/cloud/workflows/v1/workflows.proto delete mode 100644 java-workflows/synth.py diff --git a/java-workflows/.github/.OwlBot.lock.yaml b/java-workflows/.github/.OwlBot.lock.yaml new file mode 100644 index 000000000000..610d50d1efaa --- /dev/null +++ b/java-workflows/.github/.OwlBot.lock.yaml @@ -0,0 +1,3 @@ +docker: + digest: sha256:984b2b7b8d75fa16ff0e0b3dcdd1e86561b44e8eac23f7a1378db3d339f11333 + image: gcr.io/repo-automation-bots/owlbot-java:latest diff --git a/java-workflows/.github/.OwlBot.yaml b/java-workflows/.github/.OwlBot.yaml new file mode 100644 index 000000000000..5f243c3ab50e --- /dev/null +++ b/java-workflows/.github/.OwlBot.yaml @@ -0,0 +1,29 @@ +# 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 +# +# 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. + +docker: + image: "gcr.io/repo-automation-bots/owlbot-java:latest" + +deep-remove-regex: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" +- "/google-.*/src" + +deep-copy-regex: +- source: "/google/cloud/workflows/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-workflows-$1/src" +- source: "/google/cloud/workflows/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-workflows-$1/src" +- source: "/google/cloud/workflows/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-workflows/src" diff --git a/java-workflows/google-cloud-workflows-bom/pom.xml b/java-workflows/google-cloud-workflows-bom/pom.xml index 919eb7c00e92..4f0248ef755e 100644 --- a/java-workflows/google-cloud-workflows-bom/pom.xml +++ b/java-workflows/google-cloud-workflows-bom/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -64,12 +64,21 @@ - com.google.cloud google-cloud-workflows 0.3.2-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-workflows-v1beta + 0.3.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflows-v1 + 0.3.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-workflows-v1beta @@ -77,8 +86,8 @@ com.google.api.grpc - grpc-google-cloud-workflows-v1beta - 0.3.2-SNAPSHOT + proto-google-cloud-workflows-v1 + 0.3.2-SNAPSHOT @@ -94,4 +103,4 @@ - \ No newline at end of file + diff --git a/java-workflows/google-cloud-workflows/pom.xml b/java-workflows/google-cloud-workflows/pom.xml index 8d9574d0b5cf..2cb2f672c3fc 100644 --- a/java-workflows/google-cloud-workflows/pom.xml +++ b/java-workflows/google-cloud-workflows/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-workflows-v1 + com.google.api.grpc proto-google-cloud-workflows-v1beta @@ -76,6 +80,11 @@ grpc-google-cloud-workflows-v1beta test + + com.google.api.grpc + grpc-google-cloud-workflows-v1 + test + com.google.api @@ -108,4 +117,4 @@ - \ No newline at end of file + diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsClient.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsClient.java new file mode 100644 index 000000000000..e016c67171f4 --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsClient.java @@ -0,0 +1,905 @@ +/* + * 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.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.longrunning.OperationFuture; +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.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.v1.stub.WorkflowsStub; +import com.google.cloud.workflows.v1.stub.WorkflowsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Workflows is used to deploy and execute workflow programs. Workflows makes + * sure the program executes reliably, despite hardware and networking interruptions. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+ *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Workflow response = workflowsClient.getWorkflow(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the WorkflowsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

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 WorkflowsSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * WorkflowsSettings workflowsSettings =
+ *     WorkflowsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * WorkflowsClient workflowsClient = WorkflowsClient.create(workflowsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * WorkflowsSettings workflowsSettings =
+ *     WorkflowsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * WorkflowsClient workflowsClient = WorkflowsClient.create(workflowsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class WorkflowsClient implements BackgroundResource { + private final WorkflowsSettings settings; + private final WorkflowsStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of WorkflowsClient with default settings. */ + public static final WorkflowsClient create() throws IOException { + return create(WorkflowsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of WorkflowsClient, 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 WorkflowsClient create(WorkflowsSettings settings) throws IOException { + return new WorkflowsClient(settings); + } + + /** + * Constructs an instance of WorkflowsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(WorkflowsSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final WorkflowsClient create(WorkflowsStub stub) { + return new WorkflowsClient(stub); + } + + /** + * Constructs an instance of WorkflowsClient, 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 WorkflowsClient(WorkflowsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((WorkflowsStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected WorkflowsClient(WorkflowsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final WorkflowsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public WorkflowsStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Workflows in a given project and location. The default order is not specified. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Project and location from which the workflows should be listed. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkflowsPagedResponse listWorkflows(LocationName parent) { + ListWorkflowsRequest request = + ListWorkflowsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listWorkflows(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Workflows in a given project and location. The default order is not specified. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Project and location from which the workflows should be listed. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkflowsPagedResponse listWorkflows(String parent) { + ListWorkflowsRequest request = ListWorkflowsRequest.newBuilder().setParent(parent).build(); + return listWorkflows(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Workflows in a given project and location. The default order is not specified. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   ListWorkflowsRequest request =
+   *       ListWorkflowsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Workflow element : workflowsClient.listWorkflows(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest request) { + return listWorkflowsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Workflows in a given project and location. The default order is not specified. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   ListWorkflowsRequest request =
+   *       ListWorkflowsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future = workflowsClient.listWorkflowsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Workflow element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listWorkflowsPagedCallable() { + return stub.listWorkflowsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Workflows in a given project and location. The default order is not specified. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   ListWorkflowsRequest request =
+   *       ListWorkflowsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListWorkflowsResponse response = workflowsClient.listWorkflowsCallable().call(request);
+   *     for (Workflow element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listWorkflowsCallable() { + return stub.listWorkflowsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   Workflow response = workflowsClient.getWorkflow(name);
+   * }
+   * }
+ * + * @param name Required. Name of the workflow which information should be retrieved. Format: + * projects/{project}/locations/{location}/workflows/{workflow} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workflow getWorkflow(WorkflowName name) { + GetWorkflowRequest request = + GetWorkflowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getWorkflow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
+   *   Workflow response = workflowsClient.getWorkflow(name);
+   * }
+   * }
+ * + * @param name Required. Name of the workflow which information should be retrieved. Format: + * projects/{project}/locations/{location}/workflows/{workflow} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workflow getWorkflow(String name) { + GetWorkflowRequest request = GetWorkflowRequest.newBuilder().setName(name).build(); + return getWorkflow(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   GetWorkflowRequest request =
+   *       GetWorkflowRequest.newBuilder()
+   *           .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .build();
+   *   Workflow response = workflowsClient.getWorkflow(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Workflow getWorkflow(GetWorkflowRequest request) { + return getWorkflowCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   GetWorkflowRequest request =
+   *       GetWorkflowRequest.newBuilder()
+   *           .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .build();
+   *   ApiFuture future = workflowsClient.getWorkflowCallable().futureCall(request);
+   *   // Do something.
+   *   Workflow response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getWorkflowCallable() { + return stub.getWorkflowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workflow. If a workflow with the specified name already exists in the specified + * project and location, the long running operation will return + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "workflowId-360387270";
+   *   Workflow response = workflowsClient.createWorkflowAsync(parent, workflow, workflowId).get();
+   * }
+   * }
+ * + * @param parent Required. Project and location in which the workflow should be created. Format: + * projects/{project}/locations/{location} + * @param workflow Required. Workflow to be created. + * @param workflowId Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + *
    + *
  • Must contain only letters, numbers, underscores and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-64 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project and location. + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkflowAsync( + LocationName parent, Workflow workflow, String workflowId) { + CreateWorkflowRequest request = + CreateWorkflowRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setWorkflow(workflow) + .setWorkflowId(workflowId) + .build(); + return createWorkflowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workflow. If a workflow with the specified name already exists in the specified + * project and location, the long running operation will return + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "workflowId-360387270";
+   *   Workflow response = workflowsClient.createWorkflowAsync(parent, workflow, workflowId).get();
+   * }
+   * }
+ * + * @param parent Required. Project and location in which the workflow should be created. Format: + * projects/{project}/locations/{location} + * @param workflow Required. Workflow to be created. + * @param workflowId Required. The ID of the workflow to be created. It has to fulfill the + * following requirements: + *
    + *
  • Must contain only letters, numbers, underscores and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-64 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project and location. + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkflowAsync( + String parent, Workflow workflow, String workflowId) { + CreateWorkflowRequest request = + CreateWorkflowRequest.newBuilder() + .setParent(parent) + .setWorkflow(workflow) + .setWorkflowId(workflowId) + .build(); + return createWorkflowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workflow. If a workflow with the specified name already exists in the specified + * project and location, the long running operation will return + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   CreateWorkflowRequest request =
+   *       CreateWorkflowRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setWorkflowId("workflowId-360387270")
+   *           .build();
+   *   Workflow response = workflowsClient.createWorkflowAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createWorkflowAsync( + CreateWorkflowRequest request) { + return createWorkflowOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workflow. If a workflow with the specified name already exists in the specified + * project and location, the long running operation will return + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   CreateWorkflowRequest request =
+   *       CreateWorkflowRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setWorkflowId("workflowId-360387270")
+   *           .build();
+   *   OperationFuture future =
+   *       workflowsClient.createWorkflowOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workflow response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createWorkflowOperationCallable() { + return stub.createWorkflowOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new workflow. If a workflow with the specified name already exists in the specified + * project and location, the long running operation will return + * [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   CreateWorkflowRequest request =
+   *       CreateWorkflowRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setWorkflowId("workflowId-360387270")
+   *           .build();
+   *   ApiFuture future = workflowsClient.createWorkflowCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createWorkflowCallable() { + return stub.createWorkflowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a workflow with the specified name. This method also cancels and deletes all running + * executions of the workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   workflowsClient.deleteWorkflowAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workflow to be deleted. Format: + * projects/{project}/locations/{location}/workflows/{workflow} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkflowAsync(WorkflowName name) { + DeleteWorkflowRequest request = + DeleteWorkflowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteWorkflowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a workflow with the specified name. This method also cancels and deletes all running + * executions of the workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
+   *   workflowsClient.deleteWorkflowAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Name of the workflow to be deleted. Format: + * projects/{project}/locations/{location}/workflows/{workflow} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkflowAsync(String name) { + DeleteWorkflowRequest request = DeleteWorkflowRequest.newBuilder().setName(name).build(); + return deleteWorkflowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a workflow with the specified name. This method also cancels and deletes all running + * executions of the workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   DeleteWorkflowRequest request =
+   *       DeleteWorkflowRequest.newBuilder()
+   *           .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .build();
+   *   workflowsClient.deleteWorkflowAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteWorkflowAsync( + DeleteWorkflowRequest request) { + return deleteWorkflowOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a workflow with the specified name. This method also cancels and deletes all running + * executions of the workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   DeleteWorkflowRequest request =
+   *       DeleteWorkflowRequest.newBuilder()
+   *           .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       workflowsClient.deleteWorkflowOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteWorkflowOperationCallable() { + return stub.deleteWorkflowOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a workflow with the specified name. This method also cancels and deletes all running + * executions of the workflow. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   DeleteWorkflowRequest request =
+   *       DeleteWorkflowRequest.newBuilder()
+   *           .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .build();
+   *   ApiFuture future = workflowsClient.deleteWorkflowCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteWorkflowCallable() { + return stub.deleteWorkflowCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workflow. Running this method has no impact on already running executions + * of the workflow. A new revision of the workflow may be created as a result of a successful + * update operation. In that case, such revision will be used in new workflow executions. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Workflow response = workflowsClient.updateWorkflowAsync(workflow, updateMask).get();
+   * }
+   * }
+ * + * @param workflow Required. Workflow to be updated. + * @param updateMask List of fields to be updated. If not present, the entire workflow will be + * updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkflowAsync( + Workflow workflow, FieldMask updateMask) { + UpdateWorkflowRequest request = + UpdateWorkflowRequest.newBuilder().setWorkflow(workflow).setUpdateMask(updateMask).build(); + return updateWorkflowAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workflow. Running this method has no impact on already running executions + * of the workflow. A new revision of the workflow may be created as a result of a successful + * update operation. In that case, such revision will be used in new workflow executions. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   UpdateWorkflowRequest request =
+   *       UpdateWorkflowRequest.newBuilder()
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Workflow response = workflowsClient.updateWorkflowAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateWorkflowAsync( + UpdateWorkflowRequest request) { + return updateWorkflowOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workflow. Running this method has no impact on already running executions + * of the workflow. A new revision of the workflow may be created as a result of a successful + * update operation. In that case, such revision will be used in new workflow executions. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   UpdateWorkflowRequest request =
+   *       UpdateWorkflowRequest.newBuilder()
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       workflowsClient.updateWorkflowOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Workflow response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateWorkflowOperationCallable() { + return stub.updateWorkflowOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an existing workflow. Running this method has no impact on already running executions + * of the workflow. A new revision of the workflow may be created as a result of a successful + * update operation. In that case, such revision will be used in new workflow executions. + * + *

Sample code: + * + *

{@code
+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   UpdateWorkflowRequest request =
+   *       UpdateWorkflowRequest.newBuilder()
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = workflowsClient.updateWorkflowCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateWorkflowCallable() { + return stub.updateWorkflowCallable(); + } + + @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 ListWorkflowsPagedResponse + extends AbstractPagedListResponse< + ListWorkflowsRequest, + ListWorkflowsResponse, + Workflow, + ListWorkflowsPage, + ListWorkflowsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListWorkflowsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListWorkflowsPagedResponse apply(ListWorkflowsPage input) { + return new ListWorkflowsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListWorkflowsPagedResponse(ListWorkflowsPage page) { + super(page, ListWorkflowsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListWorkflowsPage + extends AbstractPage< + ListWorkflowsRequest, ListWorkflowsResponse, Workflow, ListWorkflowsPage> { + + private ListWorkflowsPage( + PageContext context, + ListWorkflowsResponse response) { + super(context, response); + } + + private static ListWorkflowsPage createEmptyPage() { + return new ListWorkflowsPage(null, null); + } + + @Override + protected ListWorkflowsPage createPage( + PageContext context, + ListWorkflowsResponse response) { + return new ListWorkflowsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListWorkflowsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListWorkflowsRequest, + ListWorkflowsResponse, + Workflow, + ListWorkflowsPage, + ListWorkflowsFixedSizeCollection> { + + private ListWorkflowsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListWorkflowsFixedSizeCollection createEmptyCollection() { + return new ListWorkflowsFixedSizeCollection(null, 0); + } + + @Override + protected ListWorkflowsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListWorkflowsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsSettings.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsSettings.java new file mode 100644 index 000000000000..bfe8c3387ae5 --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/WorkflowsSettings.java @@ -0,0 +1,265 @@ +/* + * 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.v1; + +import static com.google.cloud.workflows.v1.WorkflowsClient.ListWorkflowsPagedResponse; + +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.OperationCallSettings; +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.v1.stub.WorkflowsStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 WorkflowsClient}. + * + *

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

    + *
  • The default service address (workflows.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 getWorkflow to 30 seconds: + * + *

{@code
+ * WorkflowsSettings.Builder workflowsSettingsBuilder = WorkflowsSettings.newBuilder();
+ * workflowsSettingsBuilder
+ *     .getWorkflowSettings()
+ *     .setRetrySettings(
+ *         workflowsSettingsBuilder
+ *             .getWorkflowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WorkflowsSettings workflowsSettings = workflowsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class WorkflowsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listWorkflows. */ + public PagedCallSettings + listWorkflowsSettings() { + return ((WorkflowsStubSettings) getStubSettings()).listWorkflowsSettings(); + } + + /** Returns the object with the settings used for calls to getWorkflow. */ + public UnaryCallSettings getWorkflowSettings() { + return ((WorkflowsStubSettings) getStubSettings()).getWorkflowSettings(); + } + + /** Returns the object with the settings used for calls to createWorkflow. */ + public UnaryCallSettings createWorkflowSettings() { + return ((WorkflowsStubSettings) getStubSettings()).createWorkflowSettings(); + } + + /** Returns the object with the settings used for calls to createWorkflow. */ + public OperationCallSettings + createWorkflowOperationSettings() { + return ((WorkflowsStubSettings) getStubSettings()).createWorkflowOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkflow. */ + public UnaryCallSettings deleteWorkflowSettings() { + return ((WorkflowsStubSettings) getStubSettings()).deleteWorkflowSettings(); + } + + /** Returns the object with the settings used for calls to deleteWorkflow. */ + public OperationCallSettings + deleteWorkflowOperationSettings() { + return ((WorkflowsStubSettings) getStubSettings()).deleteWorkflowOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkflow. */ + public UnaryCallSettings updateWorkflowSettings() { + return ((WorkflowsStubSettings) getStubSettings()).updateWorkflowSettings(); + } + + /** Returns the object with the settings used for calls to updateWorkflow. */ + public OperationCallSettings + updateWorkflowOperationSettings() { + return ((WorkflowsStubSettings) getStubSettings()).updateWorkflowOperationSettings(); + } + + public static final WorkflowsSettings create(WorkflowsStubSettings stub) throws IOException { + return new WorkflowsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return WorkflowsStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return WorkflowsStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return WorkflowsStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return WorkflowsStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return WorkflowsStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return WorkflowsStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WorkflowsStubSettings.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 WorkflowsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for WorkflowsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(WorkflowsStubSettings.newBuilder(clientContext)); + } + + protected Builder(WorkflowsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(WorkflowsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(WorkflowsStubSettings.newBuilder()); + } + + public WorkflowsStubSettings.Builder getStubSettingsBuilder() { + return ((WorkflowsStubSettings.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 listWorkflows. */ + public PagedCallSettings.Builder< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> + listWorkflowsSettings() { + return getStubSettingsBuilder().listWorkflowsSettings(); + } + + /** Returns the builder for the settings used for calls to getWorkflow. */ + public UnaryCallSettings.Builder getWorkflowSettings() { + return getStubSettingsBuilder().getWorkflowSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkflow. */ + public UnaryCallSettings.Builder createWorkflowSettings() { + return getStubSettingsBuilder().createWorkflowSettings(); + } + + /** Returns the builder for the settings used for calls to createWorkflow. */ + public OperationCallSettings.Builder + createWorkflowOperationSettings() { + return getStubSettingsBuilder().createWorkflowOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkflow. */ + public UnaryCallSettings.Builder deleteWorkflowSettings() { + return getStubSettingsBuilder().deleteWorkflowSettings(); + } + + /** Returns the builder for the settings used for calls to deleteWorkflow. */ + public OperationCallSettings.Builder + deleteWorkflowOperationSettings() { + return getStubSettingsBuilder().deleteWorkflowOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkflow. */ + public UnaryCallSettings.Builder updateWorkflowSettings() { + return getStubSettingsBuilder().updateWorkflowSettings(); + } + + /** Returns the builder for the settings used for calls to updateWorkflow. */ + public OperationCallSettings.Builder + updateWorkflowOperationSettings() { + return getStubSettingsBuilder().updateWorkflowOperationSettings(); + } + + @Override + public WorkflowsSettings build() throws IOException { + return new WorkflowsSettings(this); + } + } +} diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/gapic_metadata.json b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/gapic_metadata.json new file mode 100644 index 000000000000..35bcd2f054db --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.workflows.v1", + "libraryPackage": "com.google.cloud.workflows.v1", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "WorkflowsClient", + "rpcs": { + "CreateWorkflow": { + "methods": ["createWorkflowAsync", "createWorkflowAsync", "createWorkflowAsync", "createWorkflowOperationCallable", "createWorkflowCallable"] + }, + "DeleteWorkflow": { + "methods": ["deleteWorkflowAsync", "deleteWorkflowAsync", "deleteWorkflowAsync", "deleteWorkflowOperationCallable", "deleteWorkflowCallable"] + }, + "GetWorkflow": { + "methods": ["getWorkflow", "getWorkflow", "getWorkflow", "getWorkflowCallable"] + }, + "ListWorkflows": { + "methods": ["listWorkflows", "listWorkflows", "listWorkflows", "listWorkflowsPagedCallable", "listWorkflowsCallable"] + }, + "UpdateWorkflow": { + "methods": ["updateWorkflowAsync", "updateWorkflowAsync", "updateWorkflowOperationCallable", "updateWorkflowCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/package-info.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/package-info.java new file mode 100644 index 000000000000..8068a04d8d2b --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/package-info.java @@ -0,0 +1,37 @@ +/* + * 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. + * + *

======================= WorkflowsClient ======================= + * + *

Service Description: Workflows is used to deploy and execute workflow programs. Workflows + * makes sure the program executes reliably, despite hardware and networking interruptions. + * + *

Sample for WorkflowsClient: + * + *

{@code
+ * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+ *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Workflow response = workflowsClient.getWorkflow(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.workflows.v1; + +import javax.annotation.Generated; diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsCallableFactory.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsCallableFactory.java new file mode 100644 index 000000000000..09b1b7884dff --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsCallableFactory.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.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 Workflows service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcWorkflowsCallableFactory 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/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsStub.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsStub.java new file mode 100644 index 000000000000..09419387f69e --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/GrpcWorkflowsStub.java @@ -0,0 +1,349 @@ +/* + * 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.v1.stub; + +import static com.google.cloud.workflows.v1.WorkflowsClient.ListWorkflowsPagedResponse; + +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.v1.CreateWorkflowRequest; +import com.google.cloud.workflows.v1.DeleteWorkflowRequest; +import com.google.cloud.workflows.v1.GetWorkflowRequest; +import com.google.cloud.workflows.v1.ListWorkflowsRequest; +import com.google.cloud.workflows.v1.ListWorkflowsResponse; +import com.google.cloud.workflows.v1.OperationMetadata; +import com.google.cloud.workflows.v1.UpdateWorkflowRequest; +import com.google.cloud.workflows.v1.Workflow; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +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 Workflows service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcWorkflowsStub extends WorkflowsStub { + private static final MethodDescriptor + listWorkflowsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.v1.Workflows/ListWorkflows") + .setRequestMarshaller( + ProtoUtils.marshaller(ListWorkflowsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListWorkflowsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getWorkflowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.v1.Workflows/GetWorkflow") + .setRequestMarshaller(ProtoUtils.marshaller(GetWorkflowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Workflow.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createWorkflowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.v1.Workflows/CreateWorkflow") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateWorkflowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteWorkflowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.v1.Workflows/DeleteWorkflow") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteWorkflowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateWorkflowMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.v1.Workflows/UpdateWorkflow") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWorkflowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable listWorkflowsCallable; + private final UnaryCallable + listWorkflowsPagedCallable; + private final UnaryCallable getWorkflowCallable; + private final UnaryCallable createWorkflowCallable; + private final OperationCallable + createWorkflowOperationCallable; + private final UnaryCallable deleteWorkflowCallable; + private final OperationCallable + deleteWorkflowOperationCallable; + private final UnaryCallable updateWorkflowCallable; + private final OperationCallable + updateWorkflowOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcWorkflowsStub create(WorkflowsStubSettings settings) throws IOException { + return new GrpcWorkflowsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcWorkflowsStub create(ClientContext clientContext) throws IOException { + return new GrpcWorkflowsStub(WorkflowsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcWorkflowsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcWorkflowsStub( + WorkflowsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcWorkflowsStub, 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 GrpcWorkflowsStub(WorkflowsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcWorkflowsCallableFactory()); + } + + /** + * Constructs an instance of GrpcWorkflowsStub, 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 GrpcWorkflowsStub( + WorkflowsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listWorkflowsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listWorkflowsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListWorkflowsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getWorkflowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getWorkflowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetWorkflowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createWorkflowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createWorkflowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateWorkflowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteWorkflowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteWorkflowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteWorkflowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateWorkflowTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateWorkflowMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateWorkflowRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("workflow.name", String.valueOf(request.getWorkflow().getName())); + return params.build(); + } + }) + .build(); + + this.listWorkflowsCallable = + callableFactory.createUnaryCallable( + listWorkflowsTransportSettings, settings.listWorkflowsSettings(), clientContext); + this.listWorkflowsPagedCallable = + callableFactory.createPagedCallable( + listWorkflowsTransportSettings, settings.listWorkflowsSettings(), clientContext); + this.getWorkflowCallable = + callableFactory.createUnaryCallable( + getWorkflowTransportSettings, settings.getWorkflowSettings(), clientContext); + this.createWorkflowCallable = + callableFactory.createUnaryCallable( + createWorkflowTransportSettings, settings.createWorkflowSettings(), clientContext); + this.createWorkflowOperationCallable = + callableFactory.createOperationCallable( + createWorkflowTransportSettings, + settings.createWorkflowOperationSettings(), + clientContext, + operationsStub); + this.deleteWorkflowCallable = + callableFactory.createUnaryCallable( + deleteWorkflowTransportSettings, settings.deleteWorkflowSettings(), clientContext); + this.deleteWorkflowOperationCallable = + callableFactory.createOperationCallable( + deleteWorkflowTransportSettings, + settings.deleteWorkflowOperationSettings(), + clientContext, + operationsStub); + this.updateWorkflowCallable = + callableFactory.createUnaryCallable( + updateWorkflowTransportSettings, settings.updateWorkflowSettings(), clientContext); + this.updateWorkflowOperationCallable = + callableFactory.createOperationCallable( + updateWorkflowTransportSettings, + settings.updateWorkflowOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listWorkflowsCallable() { + return listWorkflowsCallable; + } + + @Override + public UnaryCallable + listWorkflowsPagedCallable() { + return listWorkflowsPagedCallable; + } + + @Override + public UnaryCallable getWorkflowCallable() { + return getWorkflowCallable; + } + + @Override + public UnaryCallable createWorkflowCallable() { + return createWorkflowCallable; + } + + @Override + public OperationCallable + createWorkflowOperationCallable() { + return createWorkflowOperationCallable; + } + + @Override + public UnaryCallable deleteWorkflowCallable() { + return deleteWorkflowCallable; + } + + @Override + public OperationCallable + deleteWorkflowOperationCallable() { + return deleteWorkflowOperationCallable; + } + + @Override + public UnaryCallable updateWorkflowCallable() { + return updateWorkflowCallable; + } + + @Override + public OperationCallable + updateWorkflowOperationCallable() { + return updateWorkflowOperationCallable; + } + + @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/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStub.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStub.java new file mode 100644 index 000000000000..6edc34db9f28 --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStub.java @@ -0,0 +1,92 @@ +/* + * 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.v1.stub; + +import static com.google.cloud.workflows.v1.WorkflowsClient.ListWorkflowsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.v1.CreateWorkflowRequest; +import com.google.cloud.workflows.v1.DeleteWorkflowRequest; +import com.google.cloud.workflows.v1.GetWorkflowRequest; +import com.google.cloud.workflows.v1.ListWorkflowsRequest; +import com.google.cloud.workflows.v1.ListWorkflowsResponse; +import com.google.cloud.workflows.v1.OperationMetadata; +import com.google.cloud.workflows.v1.UpdateWorkflowRequest; +import com.google.cloud.workflows.v1.Workflow; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Workflows service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class WorkflowsStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listWorkflowsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkflowsPagedCallable()"); + } + + public UnaryCallable listWorkflowsCallable() { + throw new UnsupportedOperationException("Not implemented: listWorkflowsCallable()"); + } + + public UnaryCallable getWorkflowCallable() { + throw new UnsupportedOperationException("Not implemented: getWorkflowCallable()"); + } + + public OperationCallable + createWorkflowOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkflowOperationCallable()"); + } + + public UnaryCallable createWorkflowCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkflowCallable()"); + } + + public OperationCallable + deleteWorkflowOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkflowOperationCallable()"); + } + + public UnaryCallable deleteWorkflowCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkflowCallable()"); + } + + public OperationCallable + updateWorkflowOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateWorkflowOperationCallable()"); + } + + public UnaryCallable updateWorkflowCallable() { + throw new UnsupportedOperationException("Not implemented: updateWorkflowCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java new file mode 100644 index 000000000000..14b082773089 --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1/stub/WorkflowsStubSettings.java @@ -0,0 +1,562 @@ +/* + * 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.v1.stub; + +import static com.google.cloud.workflows.v1.WorkflowsClient.ListWorkflowsPagedResponse; + +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.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +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.OperationCallSettings; +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.v1.CreateWorkflowRequest; +import com.google.cloud.workflows.v1.DeleteWorkflowRequest; +import com.google.cloud.workflows.v1.GetWorkflowRequest; +import com.google.cloud.workflows.v1.ListWorkflowsRequest; +import com.google.cloud.workflows.v1.ListWorkflowsResponse; +import com.google.cloud.workflows.v1.OperationMetadata; +import com.google.cloud.workflows.v1.UpdateWorkflowRequest; +import com.google.cloud.workflows.v1.Workflow; +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 com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link WorkflowsStub}. + * + *

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

    + *
  • The default service address (workflows.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 getWorkflow to 30 seconds: + * + *

{@code
+ * WorkflowsStubSettings.Builder workflowsSettingsBuilder = WorkflowsStubSettings.newBuilder();
+ * workflowsSettingsBuilder
+ *     .getWorkflowSettings()
+ *     .setRetrySettings(
+ *         workflowsSettingsBuilder
+ *             .getWorkflowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WorkflowsStubSettings workflowsSettings = workflowsSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class WorkflowsStubSettings 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< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> + listWorkflowsSettings; + private final UnaryCallSettings getWorkflowSettings; + private final UnaryCallSettings createWorkflowSettings; + private final OperationCallSettings + createWorkflowOperationSettings; + private final UnaryCallSettings deleteWorkflowSettings; + private final OperationCallSettings + deleteWorkflowOperationSettings; + private final UnaryCallSettings updateWorkflowSettings; + private final OperationCallSettings + updateWorkflowOperationSettings; + + private static final PagedListDescriptor + LIST_WORKFLOWS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkflowsRequest injectToken(ListWorkflowsRequest payload, String token) { + return ListWorkflowsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkflowsRequest injectPageSize(ListWorkflowsRequest payload, int pageSize) { + return ListWorkflowsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWorkflowsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkflowsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWorkflowsResponse payload) { + return payload.getWorkflowsList() == null + ? ImmutableList.of() + : payload.getWorkflowsList(); + } + }; + + private static final PagedListResponseFactory< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> + LIST_WORKFLOWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWorkflowsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WORKFLOWS_PAGE_STR_DESC, request, context); + return ListWorkflowsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listWorkflows. */ + public PagedCallSettings + listWorkflowsSettings() { + return listWorkflowsSettings; + } + + /** Returns the object with the settings used for calls to getWorkflow. */ + public UnaryCallSettings getWorkflowSettings() { + return getWorkflowSettings; + } + + /** Returns the object with the settings used for calls to createWorkflow. */ + public UnaryCallSettings createWorkflowSettings() { + return createWorkflowSettings; + } + + /** Returns the object with the settings used for calls to createWorkflow. */ + public OperationCallSettings + createWorkflowOperationSettings() { + return createWorkflowOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkflow. */ + public UnaryCallSettings deleteWorkflowSettings() { + return deleteWorkflowSettings; + } + + /** Returns the object with the settings used for calls to deleteWorkflow. */ + public OperationCallSettings + deleteWorkflowOperationSettings() { + return deleteWorkflowOperationSettings; + } + + /** Returns the object with the settings used for calls to updateWorkflow. */ + public UnaryCallSettings updateWorkflowSettings() { + return updateWorkflowSettings; + } + + /** Returns the object with the settings used for calls to updateWorkflow. */ + public OperationCallSettings + updateWorkflowOperationSettings() { + return updateWorkflowOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public WorkflowsStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcWorkflowsStub.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 "workflows.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(WorkflowsStubSettings.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 WorkflowsStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listWorkflowsSettings = settingsBuilder.listWorkflowsSettings().build(); + getWorkflowSettings = settingsBuilder.getWorkflowSettings().build(); + createWorkflowSettings = settingsBuilder.createWorkflowSettings().build(); + createWorkflowOperationSettings = settingsBuilder.createWorkflowOperationSettings().build(); + deleteWorkflowSettings = settingsBuilder.deleteWorkflowSettings().build(); + deleteWorkflowOperationSettings = settingsBuilder.deleteWorkflowOperationSettings().build(); + updateWorkflowSettings = settingsBuilder.updateWorkflowSettings().build(); + updateWorkflowOperationSettings = settingsBuilder.updateWorkflowOperationSettings().build(); + } + + /** Builder for WorkflowsStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> + listWorkflowsSettings; + private final UnaryCallSettings.Builder getWorkflowSettings; + private final UnaryCallSettings.Builder + createWorkflowSettings; + private final OperationCallSettings.Builder + createWorkflowOperationSettings; + private final UnaryCallSettings.Builder + deleteWorkflowSettings; + private final OperationCallSettings.Builder + deleteWorkflowOperationSettings; + private final UnaryCallSettings.Builder + updateWorkflowSettings; + private final OperationCallSettings.Builder + updateWorkflowOperationSettings; + 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); + + listWorkflowsSettings = PagedCallSettings.newBuilder(LIST_WORKFLOWS_PAGE_STR_FACT); + getWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createWorkflowOperationSettings = OperationCallSettings.newBuilder(); + deleteWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteWorkflowOperationSettings = OperationCallSettings.newBuilder(); + updateWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateWorkflowOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listWorkflowsSettings, + getWorkflowSettings, + createWorkflowSettings, + deleteWorkflowSettings, + updateWorkflowSettings); + initDefaults(this); + } + + protected Builder(WorkflowsStubSettings settings) { + super(settings); + + listWorkflowsSettings = settings.listWorkflowsSettings.toBuilder(); + getWorkflowSettings = settings.getWorkflowSettings.toBuilder(); + createWorkflowSettings = settings.createWorkflowSettings.toBuilder(); + createWorkflowOperationSettings = settings.createWorkflowOperationSettings.toBuilder(); + deleteWorkflowSettings = settings.deleteWorkflowSettings.toBuilder(); + deleteWorkflowOperationSettings = settings.deleteWorkflowOperationSettings.toBuilder(); + updateWorkflowSettings = settings.updateWorkflowSettings.toBuilder(); + updateWorkflowOperationSettings = settings.updateWorkflowOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listWorkflowsSettings, + getWorkflowSettings, + createWorkflowSettings, + deleteWorkflowSettings, + updateWorkflowSettings); + } + + 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 + .listWorkflowsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createWorkflowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workflow.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteWorkflowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateWorkflowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workflow.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + 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 listWorkflows. */ + public PagedCallSettings.Builder< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> + listWorkflowsSettings() { + return listWorkflowsSettings; + } + + /** Returns the builder for the settings used for calls to getWorkflow. */ + public UnaryCallSettings.Builder getWorkflowSettings() { + return getWorkflowSettings; + } + + /** Returns the builder for the settings used for calls to createWorkflow. */ + public UnaryCallSettings.Builder createWorkflowSettings() { + return createWorkflowSettings; + } + + /** Returns the builder for the settings used for calls to createWorkflow. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createWorkflowOperationSettings() { + return createWorkflowOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkflow. */ + public UnaryCallSettings.Builder deleteWorkflowSettings() { + return deleteWorkflowSettings; + } + + /** Returns the builder for the settings used for calls to deleteWorkflow. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteWorkflowOperationSettings() { + return deleteWorkflowOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkflow. */ + public UnaryCallSettings.Builder updateWorkflowSettings() { + return updateWorkflowSettings; + } + + /** Returns the builder for the settings used for calls to updateWorkflow. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateWorkflowOperationSettings() { + return updateWorkflowOperationSettings; + } + + @Override + public WorkflowsStubSettings build() throws IOException { + return new WorkflowsStubSettings(this); + } + } +} diff --git a/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflows.java b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflows.java new file mode 100644 index 000000000000..37fc8ff36ac0 --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflows.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.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 MockWorkflows implements MockGrpcService { + private final MockWorkflowsImpl serviceImpl; + + public MockWorkflows() { + serviceImpl = new MockWorkflowsImpl(); + } + + @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/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflowsImpl.java b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflowsImpl.java new file mode 100644 index 000000000000..1e1e6b8b8ebb --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/MockWorkflowsImpl.java @@ -0,0 +1,165 @@ +/* + * 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.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.workflows.v1.WorkflowsGrpc.WorkflowsImplBase; +import com.google.longrunning.Operation; +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 MockWorkflowsImpl extends WorkflowsImplBase { + private List requests; + private Queue responses; + + public MockWorkflowsImpl() { + 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 listWorkflows( + ListWorkflowsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListWorkflowsResponse) { + requests.add(request); + responseObserver.onNext(((ListWorkflowsResponse) 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 ListWorkflows, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListWorkflowsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getWorkflow(GetWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Workflow) { + requests.add(request); + responseObserver.onNext(((Workflow) 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 GetWorkflow, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Workflow.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createWorkflow( + CreateWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 CreateWorkflow, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteWorkflow( + DeleteWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 DeleteWorkflow, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateWorkflow( + UpdateWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 UpdateWorkflow, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/WorkflowsClientTest.java b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/WorkflowsClientTest.java new file mode 100644 index 000000000000..19bf34ee8d21 --- /dev/null +++ b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1/WorkflowsClientTest.java @@ -0,0 +1,524 @@ +/* + * 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.v1; + +import static com.google.cloud.workflows.v1.WorkflowsClient.ListWorkflowsPagedResponse; + +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.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +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 WorkflowsClientTest { + private static MockServiceHelper mockServiceHelper; + private WorkflowsClient client; + private LocalChannelProvider channelProvider; + private static MockWorkflows mockWorkflows; + + @BeforeClass + public static void startStaticServer() { + mockWorkflows = new MockWorkflows(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockWorkflows)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + WorkflowsSettings settings = + WorkflowsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WorkflowsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listWorkflowsTest() throws Exception { + Workflow responsesElement = Workflow.newBuilder().build(); + ListWorkflowsResponse expectedResponse = + ListWorkflowsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkflows(Arrays.asList(responsesElement)) + .build(); + mockWorkflows.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListWorkflowsPagedResponse pagedListResponse = client.listWorkflows(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkflowsList().get(0), resources.get(0)); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkflowsRequest actualRequest = ((ListWorkflowsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkflowsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listWorkflows(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkflowsTest2() throws Exception { + Workflow responsesElement = Workflow.newBuilder().build(); + ListWorkflowsResponse expectedResponse = + ListWorkflowsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkflows(Arrays.asList(responsesElement)) + .build(); + mockWorkflows.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkflowsPagedResponse pagedListResponse = client.listWorkflows(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkflowsList().get(0), resources.get(0)); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkflowsRequest actualRequest = ((ListWorkflowsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkflowsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String parent = "parent-995424086"; + client.listWorkflows(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkflowTest() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + mockWorkflows.addResponse(expectedResponse); + + WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + + Workflow actualResponse = client.getWorkflow(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkflowRequest actualRequest = ((GetWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + client.getWorkflow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkflowTest2() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + mockWorkflows.addResponse(expectedResponse); + + String name = "name3373707"; + + Workflow actualResponse = client.getWorkflow(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkflowRequest actualRequest = ((GetWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkflowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String name = "name3373707"; + client.getWorkflow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWorkflowTest() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId-360387270"; + + Workflow actualResponse = client.createWorkflowAsync(parent, workflow, workflowId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkflowRequest actualRequest = ((CreateWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(workflow, actualRequest.getWorkflow()); + Assert.assertEquals(workflowId, actualRequest.getWorkflowId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId-360387270"; + client.createWorkflowAsync(parent, workflow, workflowId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createWorkflowTest2() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + + String parent = "parent-995424086"; + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId-360387270"; + + Workflow actualResponse = client.createWorkflowAsync(parent, workflow, workflowId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkflowRequest actualRequest = ((CreateWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(workflow, actualRequest.getWorkflow()); + Assert.assertEquals(workflowId, actualRequest.getWorkflowId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkflowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String parent = "parent-995424086"; + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId-360387270"; + client.createWorkflowAsync(parent, workflow, workflowId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkflowTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + + WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + + client.deleteWorkflowAsync(name).get(); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkflowRequest actualRequest = ((DeleteWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + client.deleteWorkflowAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkflowTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteWorkflowAsync(name).get(); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkflowRequest actualRequest = ((DeleteWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkflowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String name = "name3373707"; + client.deleteWorkflowAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateWorkflowTest() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + + Workflow workflow = Workflow.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Workflow actualResponse = client.updateWorkflowAsync(workflow, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateWorkflowRequest actualRequest = ((UpdateWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(workflow, actualRequest.getWorkflow()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + Workflow workflow = Workflow.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateWorkflowAsync(workflow, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-workflows/grpc-google-cloud-workflows-v1/pom.xml b/java-workflows/grpc-google-cloud-workflows-v1/pom.xml new file mode 100644 index 000000000000..2d2b6f24446d --- /dev/null +++ b/java-workflows/grpc-google-cloud-workflows-v1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-workflows-v1 + 0.3.2-SNAPSHOT + grpc-google-cloud-workflows-v1 + GRPC library for google-cloud-workflows + + com.google.cloud + google-cloud-workflows-parent + 0.3.2-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-workflows-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/java-workflows/grpc-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsGrpc.java b/java-workflows/grpc-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsGrpc.java new file mode 100644 index 000000000000..80743afd342f --- /dev/null +++ b/java-workflows/grpc-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsGrpc.java @@ -0,0 +1,851 @@ +/* + * 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.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Workflows is used to deploy and execute workflow programs.
+ * Workflows makes sure the program executes reliably, despite hardware and
+ * networking interruptions.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/workflows/v1/workflows.proto") +public final class WorkflowsGrpc { + + private WorkflowsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.workflows.v1.Workflows"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.ListWorkflowsRequest, + com.google.cloud.workflows.v1.ListWorkflowsResponse> + getListWorkflowsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkflows", + requestType = com.google.cloud.workflows.v1.ListWorkflowsRequest.class, + responseType = com.google.cloud.workflows.v1.ListWorkflowsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.ListWorkflowsRequest, + com.google.cloud.workflows.v1.ListWorkflowsResponse> + getListWorkflowsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.ListWorkflowsRequest, + com.google.cloud.workflows.v1.ListWorkflowsResponse> + getListWorkflowsMethod; + if ((getListWorkflowsMethod = WorkflowsGrpc.getListWorkflowsMethod) == null) { + synchronized (WorkflowsGrpc.class) { + if ((getListWorkflowsMethod = WorkflowsGrpc.getListWorkflowsMethod) == null) { + WorkflowsGrpc.getListWorkflowsMethod = + getListWorkflowsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListWorkflows")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.ListWorkflowsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.ListWorkflowsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("ListWorkflows")) + .build(); + } + } + } + return getListWorkflowsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.GetWorkflowRequest, com.google.cloud.workflows.v1.Workflow> + getGetWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkflow", + requestType = com.google.cloud.workflows.v1.GetWorkflowRequest.class, + responseType = com.google.cloud.workflows.v1.Workflow.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.GetWorkflowRequest, com.google.cloud.workflows.v1.Workflow> + getGetWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.GetWorkflowRequest, + com.google.cloud.workflows.v1.Workflow> + getGetWorkflowMethod; + if ((getGetWorkflowMethod = WorkflowsGrpc.getGetWorkflowMethod) == null) { + synchronized (WorkflowsGrpc.class) { + if ((getGetWorkflowMethod = WorkflowsGrpc.getGetWorkflowMethod) == null) { + WorkflowsGrpc.getGetWorkflowMethod = + getGetWorkflowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetWorkflow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.GetWorkflowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.Workflow.getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("GetWorkflow")) + .build(); + } + } + } + return getGetWorkflowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.CreateWorkflowRequest, com.google.longrunning.Operation> + getCreateWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWorkflow", + requestType = com.google.cloud.workflows.v1.CreateWorkflowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.CreateWorkflowRequest, com.google.longrunning.Operation> + getCreateWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.CreateWorkflowRequest, com.google.longrunning.Operation> + getCreateWorkflowMethod; + if ((getCreateWorkflowMethod = WorkflowsGrpc.getCreateWorkflowMethod) == null) { + synchronized (WorkflowsGrpc.class) { + if ((getCreateWorkflowMethod = WorkflowsGrpc.getCreateWorkflowMethod) == null) { + WorkflowsGrpc.getCreateWorkflowMethod = + getCreateWorkflowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateWorkflow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.CreateWorkflowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("CreateWorkflow")) + .build(); + } + } + } + return getCreateWorkflowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.DeleteWorkflowRequest, com.google.longrunning.Operation> + getDeleteWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWorkflow", + requestType = com.google.cloud.workflows.v1.DeleteWorkflowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.DeleteWorkflowRequest, com.google.longrunning.Operation> + getDeleteWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.DeleteWorkflowRequest, com.google.longrunning.Operation> + getDeleteWorkflowMethod; + if ((getDeleteWorkflowMethod = WorkflowsGrpc.getDeleteWorkflowMethod) == null) { + synchronized (WorkflowsGrpc.class) { + if ((getDeleteWorkflowMethod = WorkflowsGrpc.getDeleteWorkflowMethod) == null) { + WorkflowsGrpc.getDeleteWorkflowMethod = + getDeleteWorkflowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteWorkflow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.DeleteWorkflowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("DeleteWorkflow")) + .build(); + } + } + } + return getDeleteWorkflowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.UpdateWorkflowRequest, com.google.longrunning.Operation> + getUpdateWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWorkflow", + requestType = com.google.cloud.workflows.v1.UpdateWorkflowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.UpdateWorkflowRequest, com.google.longrunning.Operation> + getUpdateWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1.UpdateWorkflowRequest, com.google.longrunning.Operation> + getUpdateWorkflowMethod; + if ((getUpdateWorkflowMethod = WorkflowsGrpc.getUpdateWorkflowMethod) == null) { + synchronized (WorkflowsGrpc.class) { + if ((getUpdateWorkflowMethod = WorkflowsGrpc.getUpdateWorkflowMethod) == null) { + WorkflowsGrpc.getUpdateWorkflowMethod = + getUpdateWorkflowMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateWorkflow")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1.UpdateWorkflowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("UpdateWorkflow")) + .build(); + } + } + } + return getUpdateWorkflowMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static WorkflowsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WorkflowsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkflowsStub(channel, callOptions); + } + }; + return WorkflowsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static WorkflowsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WorkflowsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkflowsBlockingStub(channel, callOptions); + } + }; + return WorkflowsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static WorkflowsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WorkflowsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkflowsFutureStub(channel, callOptions); + } + }; + return WorkflowsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Workflows is used to deploy and execute workflow programs.
+   * Workflows makes sure the program executes reliably, despite hardware and
+   * networking interruptions.
+   * 
+ */ + public abstract static class WorkflowsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Lists Workflows in a given project and location.
+     * The default order is not specified.
+     * 
+ */ + public void listWorkflows( + com.google.cloud.workflows.v1.ListWorkflowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListWorkflowsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public void getWorkflow( + com.google.cloud.workflows.v1.GetWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetWorkflowMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new workflow. If a workflow with the specified name already
+     * exists in the specified project and location, the long running operation
+     * will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public void createWorkflow( + com.google.cloud.workflows.v1.CreateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateWorkflowMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a workflow with the specified name.
+     * This method also cancels and deletes all running executions of the
+     * workflow.
+     * 
+ */ + public void deleteWorkflow( + com.google.cloud.workflows.v1.DeleteWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteWorkflowMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates an existing workflow.
+     * Running this method has no impact on already running executions of the
+     * workflow. A new revision of the workflow may be created as a result of a
+     * successful update operation. In that case, such revision will be used
+     * in new workflow executions.
+     * 
+ */ + public void updateWorkflow( + com.google.cloud.workflows.v1.UpdateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateWorkflowMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListWorkflowsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1.ListWorkflowsRequest, + com.google.cloud.workflows.v1.ListWorkflowsResponse>( + this, METHODID_LIST_WORKFLOWS))) + .addMethod( + getGetWorkflowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1.GetWorkflowRequest, + com.google.cloud.workflows.v1.Workflow>(this, METHODID_GET_WORKFLOW))) + .addMethod( + getCreateWorkflowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1.CreateWorkflowRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_WORKFLOW))) + .addMethod( + getDeleteWorkflowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1.DeleteWorkflowRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_WORKFLOW))) + .addMethod( + getUpdateWorkflowMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1.UpdateWorkflowRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_WORKFLOW))) + .build(); + } + } + + /** + * + * + *
+   * Workflows is used to deploy and execute workflow programs.
+   * Workflows makes sure the program executes reliably, despite hardware and
+   * networking interruptions.
+   * 
+ */ + public static final class WorkflowsStub extends io.grpc.stub.AbstractAsyncStub { + private WorkflowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WorkflowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkflowsStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Workflows in a given project and location.
+     * The default order is not specified.
+     * 
+ */ + public void listWorkflows( + com.google.cloud.workflows.v1.ListWorkflowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListWorkflowsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public void getWorkflow( + com.google.cloud.workflows.v1.GetWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetWorkflowMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new workflow. If a workflow with the specified name already
+     * exists in the specified project and location, the long running operation
+     * will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public void createWorkflow( + com.google.cloud.workflows.v1.CreateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateWorkflowMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a workflow with the specified name.
+     * This method also cancels and deletes all running executions of the
+     * workflow.
+     * 
+ */ + public void deleteWorkflow( + com.google.cloud.workflows.v1.DeleteWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteWorkflowMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates an existing workflow.
+     * Running this method has no impact on already running executions of the
+     * workflow. A new revision of the workflow may be created as a result of a
+     * successful update operation. In that case, such revision will be used
+     * in new workflow executions.
+     * 
+ */ + public void updateWorkflow( + com.google.cloud.workflows.v1.UpdateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateWorkflowMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Workflows is used to deploy and execute workflow programs.
+   * Workflows makes sure the program executes reliably, despite hardware and
+   * networking interruptions.
+   * 
+ */ + public static final class WorkflowsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private WorkflowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WorkflowsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkflowsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Workflows in a given project and location.
+     * The default order is not specified.
+     * 
+ */ + public com.google.cloud.workflows.v1.ListWorkflowsResponse listWorkflows( + com.google.cloud.workflows.v1.ListWorkflowsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListWorkflowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public com.google.cloud.workflows.v1.Workflow getWorkflow( + com.google.cloud.workflows.v1.GetWorkflowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetWorkflowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new workflow. If a workflow with the specified name already
+     * exists in the specified project and location, the long running operation
+     * will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public com.google.longrunning.Operation createWorkflow( + com.google.cloud.workflows.v1.CreateWorkflowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateWorkflowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a workflow with the specified name.
+     * This method also cancels and deletes all running executions of the
+     * workflow.
+     * 
+ */ + public com.google.longrunning.Operation deleteWorkflow( + com.google.cloud.workflows.v1.DeleteWorkflowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteWorkflowMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates an existing workflow.
+     * Running this method has no impact on already running executions of the
+     * workflow. A new revision of the workflow may be created as a result of a
+     * successful update operation. In that case, such revision will be used
+     * in new workflow executions.
+     * 
+ */ + public com.google.longrunning.Operation updateWorkflow( + com.google.cloud.workflows.v1.UpdateWorkflowRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateWorkflowMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Workflows is used to deploy and execute workflow programs.
+   * Workflows makes sure the program executes reliably, despite hardware and
+   * networking interruptions.
+   * 
+ */ + public static final class WorkflowsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private WorkflowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WorkflowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WorkflowsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists Workflows in a given project and location.
+     * The default order is not specified.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.v1.ListWorkflowsResponse> + listWorkflows(com.google.cloud.workflows.v1.ListWorkflowsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListWorkflowsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.v1.Workflow> + getWorkflow(com.google.cloud.workflows.v1.GetWorkflowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetWorkflowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new workflow. If a workflow with the specified name already
+     * exists in the specified project and location, the long running operation
+     * will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createWorkflow(com.google.cloud.workflows.v1.CreateWorkflowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateWorkflowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a workflow with the specified name.
+     * This method also cancels and deletes all running executions of the
+     * workflow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteWorkflow(com.google.cloud.workflows.v1.DeleteWorkflowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteWorkflowMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates an existing workflow.
+     * Running this method has no impact on already running executions of the
+     * workflow. A new revision of the workflow may be created as a result of a
+     * successful update operation. In that case, such revision will be used
+     * in new workflow executions.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateWorkflow(com.google.cloud.workflows.v1.UpdateWorkflowRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateWorkflowMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_WORKFLOWS = 0; + private static final int METHODID_GET_WORKFLOW = 1; + private static final int METHODID_CREATE_WORKFLOW = 2; + private static final int METHODID_DELETE_WORKFLOW = 3; + private static final int METHODID_UPDATE_WORKFLOW = 4; + + 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 WorkflowsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(WorkflowsImplBase 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_WORKFLOWS: + serviceImpl.listWorkflows( + (com.google.cloud.workflows.v1.ListWorkflowsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_WORKFLOW: + serviceImpl.getWorkflow( + (com.google.cloud.workflows.v1.GetWorkflowRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_WORKFLOW: + serviceImpl.createWorkflow( + (com.google.cloud.workflows.v1.CreateWorkflowRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_WORKFLOW: + serviceImpl.deleteWorkflow( + (com.google.cloud.workflows.v1.DeleteWorkflowRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_WORKFLOW: + serviceImpl.updateWorkflow( + (com.google.cloud.workflows.v1.UpdateWorkflowRequest) 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 WorkflowsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + WorkflowsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Workflows"); + } + } + + private static final class WorkflowsFileDescriptorSupplier + extends WorkflowsBaseDescriptorSupplier { + WorkflowsFileDescriptorSupplier() {} + } + + private static final class WorkflowsMethodDescriptorSupplier + extends WorkflowsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + WorkflowsMethodDescriptorSupplier(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 (WorkflowsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new WorkflowsFileDescriptorSupplier()) + .addMethod(getListWorkflowsMethod()) + .addMethod(getGetWorkflowMethod()) + .addMethod(getCreateWorkflowMethod()) + .addMethod(getDeleteWorkflowMethod()) + .addMethod(getUpdateWorkflowMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-workflows/owlbot.py b/java-workflows/owlbot.py new file mode 100644 index 000000000000..dca9d8672536 --- /dev/null +++ b/java-workflows/owlbot.py @@ -0,0 +1,24 @@ +# 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. + +import synthtool as s +from synthtool.languages import java + + +for library in s.get_staging_dirs(): + # put any special-case replacements here + s.move(library) + +s.remove_staging_dirs() +java.common_templates() diff --git a/java-workflows/pom.xml b/java-workflows/pom.xml index 5eb1c747daa3..f62ec9241650 100644 --- a/java-workflows/pom.xml +++ b/java-workflows/pom.xml @@ -72,6 +72,16 @@ google-cloud-workflows 0.3.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-workflows-v1 + 0.3.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflows-v1 + 0.3.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-workflows-v1beta @@ -112,8 +122,10 @@ google-cloud-workflows - proto-google-cloud-workflows-v1beta grpc-google-cloud-workflows-v1beta + grpc-google-cloud-workflows-v1 + proto-google-cloud-workflows-v1beta + proto-google-cloud-workflows-v1 google-cloud-workflows-bom @@ -186,4 +198,4 @@ - \ No newline at end of file + diff --git a/java-workflows/proto-google-cloud-workflows-v1/clirr-ignored-differences.xml b/java-workflows/proto-google-cloud-workflows-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..eaa397b12f04 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/workflows/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/workflows/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/workflows/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-workflows/proto-google-cloud-workflows-v1/pom.xml b/java-workflows/proto-google-cloud-workflows-v1/pom.xml new file mode 100644 index 000000000000..34ecbbd953bb --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-workflows-v1 + 0.3.2-SNAPSHOT + proto-google-cloud-workflows-v1 + Proto library for google-cloud-workflows + + com.google.cloud + google-cloud-workflows-parent + 0.3.2-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/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequest.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequest.java new file mode 100644 index 000000000000..47bff2efbcb2 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequest.java @@ -0,0 +1,1183 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Request for the
+ * [CreateWorkflow][google.cloud.workflows.v1.Workflows.CreateWorkflow]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.CreateWorkflowRequest} + */ +public final class CreateWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.CreateWorkflowRequest) + CreateWorkflowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateWorkflowRequest.newBuilder() to construct. + private CreateWorkflowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateWorkflowRequest() { + parent_ = ""; + workflowId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateWorkflowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateWorkflowRequest( + 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.v1.Workflow.Builder subBuilder = null; + if (workflow_ != null) { + subBuilder = workflow_.toBuilder(); + } + workflow_ = + input.readMessage( + com.google.cloud.workflows.v1.Workflow.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workflow_); + workflow_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + workflowId_ = 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.CreateWorkflowRequest.class, + com.google.cloud.workflows.v1.CreateWorkflowRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Project and location in which the workflow should be created.
+   * Format:  projects/{project}/locations/{location}
+   * 
+ * + * + * 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. Project and location in which the workflow should be created.
+   * Format:  projects/{project}/locations/{location}
+   * 
+ * + * + * 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 WORKFLOW_FIELD_NUMBER = 2; + private com.google.cloud.workflows.v1.Workflow workflow_; + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workflow field is set. + */ + @java.lang.Override + public boolean hasWorkflow() { + return workflow_ != null; + } + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow getWorkflow() { + return workflow_ == null + ? com.google.cloud.workflows.v1.Workflow.getDefaultInstance() + : workflow_; + } + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowOrBuilder() { + return getWorkflow(); + } + + public static final int WORKFLOW_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object workflowId_; + /** + * + * + *
+   * Required. The ID of the workflow to be created. It has to fulfill the
+   * following requirements:
+   * * Must contain only letters, numbers, underscores and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-64 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project and location.
+   * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workflowId. + */ + @java.lang.Override + public java.lang.String getWorkflowId() { + java.lang.Object ref = workflowId_; + 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(); + workflowId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the workflow to be created. It has to fulfill the
+   * following requirements:
+   * * Must contain only letters, numbers, underscores and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-64 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project and location.
+   * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workflowId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkflowIdBytes() { + java.lang.Object ref = workflowId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workflowId_ = 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (workflow_ != null) { + output.writeMessage(2, getWorkflow()); + } + if (!getWorkflowIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, workflowId_); + } + 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 (workflow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getWorkflow()); + } + if (!getWorkflowIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, workflowId_); + } + 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.v1.CreateWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.CreateWorkflowRequest other = + (com.google.cloud.workflows.v1.CreateWorkflowRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasWorkflow() != other.hasWorkflow()) return false; + if (hasWorkflow()) { + if (!getWorkflow().equals(other.getWorkflow())) return false; + } + if (!getWorkflowId().equals(other.getWorkflowId())) 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 (hasWorkflow()) { + hash = (37 * hash) + WORKFLOW_FIELD_NUMBER; + hash = (53 * hash) + getWorkflow().hashCode(); + } + hash = (37 * hash) + WORKFLOW_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkflowId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest 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.v1.CreateWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest 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.v1.CreateWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest 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.v1.CreateWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest 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.v1.CreateWorkflowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest 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.v1.CreateWorkflowRequest 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
+   * [CreateWorkflow][google.cloud.workflows.v1.Workflows.CreateWorkflow]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.CreateWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.CreateWorkflowRequest) + com.google.cloud.workflows.v1.CreateWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.CreateWorkflowRequest.class, + com.google.cloud.workflows.v1.CreateWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.CreateWorkflowRequest.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 (workflowBuilder_ == null) { + workflow_ = null; + } else { + workflow_ = null; + workflowBuilder_ = null; + } + workflowId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.CreateWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.CreateWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.CreateWorkflowRequest build() { + com.google.cloud.workflows.v1.CreateWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.CreateWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1.CreateWorkflowRequest result = + new com.google.cloud.workflows.v1.CreateWorkflowRequest(this); + result.parent_ = parent_; + if (workflowBuilder_ == null) { + result.workflow_ = workflow_; + } else { + result.workflow_ = workflowBuilder_.build(); + } + result.workflowId_ = workflowId_; + 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.v1.CreateWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1.CreateWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.CreateWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1.CreateWorkflowRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasWorkflow()) { + mergeWorkflow(other.getWorkflow()); + } + if (!other.getWorkflowId().isEmpty()) { + workflowId_ = other.workflowId_; + 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.v1.CreateWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1.CreateWorkflowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Project and location in which the workflow should be created.
+     * Format:  projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location in which the workflow should be created.
+     * Format:  projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location in which the workflow should be created.
+     * Format:  projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location in which the workflow should be created.
+     * Format:  projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location in which the workflow should be created.
+     * Format:  projects/{project}/locations/{location}
+     * 
+ * + * + * 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.v1.Workflow workflow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder> + workflowBuilder_; + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workflow field is set. + */ + public boolean hasWorkflow() { + return workflowBuilder_ != null || workflow_ != null; + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + public com.google.cloud.workflows.v1.Workflow getWorkflow() { + if (workflowBuilder_ == null) { + return workflow_ == null + ? com.google.cloud.workflows.v1.Workflow.getDefaultInstance() + : workflow_; + } else { + return workflowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1.Workflow value) { + if (workflowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workflow_ = value; + onChanged(); + } else { + workflowBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1.Workflow.Builder builderForValue) { + if (workflowBuilder_ == null) { + workflow_ = builderForValue.build(); + onChanged(); + } else { + workflowBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkflow(com.google.cloud.workflows.v1.Workflow value) { + if (workflowBuilder_ == null) { + if (workflow_ != null) { + workflow_ = + com.google.cloud.workflows.v1.Workflow.newBuilder(workflow_) + .mergeFrom(value) + .buildPartial(); + } else { + workflow_ = value; + } + onChanged(); + } else { + workflowBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkflow() { + if (workflowBuilder_ == null) { + workflow_ = null; + onChanged(); + } else { + workflow_ = null; + workflowBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1.Workflow.Builder getWorkflowBuilder() { + + onChanged(); + return getWorkflowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowOrBuilder() { + if (workflowBuilder_ != null) { + return workflowBuilder_.getMessageOrBuilder(); + } else { + return workflow_ == null + ? com.google.cloud.workflows.v1.Workflow.getDefaultInstance() + : workflow_; + } + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder> + getWorkflowFieldBuilder() { + if (workflowBuilder_ == null) { + workflowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder>( + getWorkflow(), getParentForChildren(), isClean()); + workflow_ = null; + } + return workflowBuilder_; + } + + private java.lang.Object workflowId_ = ""; + /** + * + * + *
+     * Required. The ID of the workflow to be created. It has to fulfill the
+     * following requirements:
+     * * Must contain only letters, numbers, underscores and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-64 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project and location.
+     * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workflowId. + */ + public java.lang.String getWorkflowId() { + java.lang.Object ref = workflowId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workflowId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the workflow to be created. It has to fulfill the
+     * following requirements:
+     * * Must contain only letters, numbers, underscores and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-64 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project and location.
+     * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workflowId. + */ + public com.google.protobuf.ByteString getWorkflowIdBytes() { + java.lang.Object ref = workflowId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workflowId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the workflow to be created. It has to fulfill the
+     * following requirements:
+     * * Must contain only letters, numbers, underscores and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-64 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project and location.
+     * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The workflowId to set. + * @return This builder for chaining. + */ + public Builder setWorkflowId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workflowId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the workflow to be created. It has to fulfill the
+     * following requirements:
+     * * Must contain only letters, numbers, underscores and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-64 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project and location.
+     * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearWorkflowId() { + + workflowId_ = getDefaultInstance().getWorkflowId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the workflow to be created. It has to fulfill the
+     * following requirements:
+     * * Must contain only letters, numbers, underscores and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-64 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project and location.
+     * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for workflowId to set. + * @return This builder for chaining. + */ + public Builder setWorkflowIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workflowId_ = 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.v1.CreateWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.CreateWorkflowRequest) + private static final com.google.cloud.workflows.v1.CreateWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.CreateWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1.CreateWorkflowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateWorkflowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateWorkflowRequest(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.v1.CreateWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequestOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequestOrBuilder.java new file mode 100644 index 000000000000..0ae2af768c30 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/CreateWorkflowRequestOrBuilder.java @@ -0,0 +1,134 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface CreateWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.CreateWorkflowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Project and location in which the workflow should be created.
+   * Format:  projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Project and location in which the workflow should be created.
+   * Format:  projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workflow field is set. + */ + boolean hasWorkflow(); + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + com.google.cloud.workflows.v1.Workflow getWorkflow(); + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowOrBuilder(); + + /** + * + * + *
+   * Required. The ID of the workflow to be created. It has to fulfill the
+   * following requirements:
+   * * Must contain only letters, numbers, underscores and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-64 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project and location.
+   * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The workflowId. + */ + java.lang.String getWorkflowId(); + /** + * + * + *
+   * Required. The ID of the workflow to be created. It has to fulfill the
+   * following requirements:
+   * * Must contain only letters, numbers, underscores and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-64 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project and location.
+   * 
+ * + * string workflow_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for workflowId. + */ + com.google.protobuf.ByteString getWorkflowIdBytes(); +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequest.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequest.java new file mode 100644 index 000000000000..f4f28ecf8d7d --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequest.java @@ -0,0 +1,661 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Request for the
+ * [DeleteWorkflow][google.cloud.workflows.v1.Workflows.DeleteWorkflow]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.DeleteWorkflowRequest} + */ +public final class DeleteWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.DeleteWorkflowRequest) + DeleteWorkflowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteWorkflowRequest.newBuilder() to construct. + private DeleteWorkflowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteWorkflowRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteWorkflowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteWorkflowRequest( + 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.DeleteWorkflowRequest.class, + com.google.cloud.workflows.v1.DeleteWorkflowRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the workflow to be deleted.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * 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 workflow to be deleted.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * 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.v1.DeleteWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.DeleteWorkflowRequest other = + (com.google.cloud.workflows.v1.DeleteWorkflowRequest) 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.v1.DeleteWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest 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.v1.DeleteWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest 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.v1.DeleteWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest 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.v1.DeleteWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest 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.v1.DeleteWorkflowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest 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.v1.DeleteWorkflowRequest 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
+   * [DeleteWorkflow][google.cloud.workflows.v1.Workflows.DeleteWorkflow]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.DeleteWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.DeleteWorkflowRequest) + com.google.cloud.workflows.v1.DeleteWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.DeleteWorkflowRequest.class, + com.google.cloud.workflows.v1.DeleteWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.DeleteWorkflowRequest.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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.DeleteWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.DeleteWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.DeleteWorkflowRequest build() { + com.google.cloud.workflows.v1.DeleteWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.DeleteWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1.DeleteWorkflowRequest result = + new com.google.cloud.workflows.v1.DeleteWorkflowRequest(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.v1.DeleteWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1.DeleteWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.DeleteWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1.DeleteWorkflowRequest.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.v1.DeleteWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1.DeleteWorkflowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the workflow to be deleted.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow to be deleted.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow to be deleted.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow to be deleted.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow to be deleted.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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.v1.DeleteWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.DeleteWorkflowRequest) + private static final com.google.cloud.workflows.v1.DeleteWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.DeleteWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1.DeleteWorkflowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteWorkflowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteWorkflowRequest(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.v1.DeleteWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequestOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequestOrBuilder.java new file mode 100644 index 000000000000..ae5c9716de05 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/DeleteWorkflowRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface DeleteWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.DeleteWorkflowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workflow to be deleted.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the workflow to be deleted.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * 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/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequest.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequest.java new file mode 100644 index 000000000000..0e29c68866d6 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequest.java @@ -0,0 +1,658 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Request for the
+ * [GetWorkflow][google.cloud.workflows.v1.Workflows.GetWorkflow] method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.GetWorkflowRequest} + */ +public final class GetWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.GetWorkflowRequest) + GetWorkflowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetWorkflowRequest.newBuilder() to construct. + private GetWorkflowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetWorkflowRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetWorkflowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetWorkflowRequest( + 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_GetWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_GetWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.GetWorkflowRequest.class, + com.google.cloud.workflows.v1.GetWorkflowRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the workflow which information should be retrieved.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * 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 workflow which information should be retrieved.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * 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.v1.GetWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.GetWorkflowRequest other = + (com.google.cloud.workflows.v1.GetWorkflowRequest) 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.v1.GetWorkflowRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest 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.v1.GetWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest 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.v1.GetWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest 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.v1.GetWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest 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.v1.GetWorkflowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest 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.v1.GetWorkflowRequest 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
+   * [GetWorkflow][google.cloud.workflows.v1.Workflows.GetWorkflow] method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.GetWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.GetWorkflowRequest) + com.google.cloud.workflows.v1.GetWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_GetWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_GetWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.GetWorkflowRequest.class, + com.google.cloud.workflows.v1.GetWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.GetWorkflowRequest.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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_GetWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.GetWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.GetWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.GetWorkflowRequest build() { + com.google.cloud.workflows.v1.GetWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.GetWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1.GetWorkflowRequest result = + new com.google.cloud.workflows.v1.GetWorkflowRequest(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.v1.GetWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1.GetWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.GetWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1.GetWorkflowRequest.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.v1.GetWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.workflows.v1.GetWorkflowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the workflow which information should be retrieved.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow which information should be retrieved.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow which information should be retrieved.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow which information should be retrieved.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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 workflow which information should be retrieved.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * 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.v1.GetWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.GetWorkflowRequest) + private static final com.google.cloud.workflows.v1.GetWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.GetWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1.GetWorkflowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetWorkflowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorkflowRequest(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.v1.GetWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequestOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequestOrBuilder.java new file mode 100644 index 000000000000..e72ab770ca7b --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/GetWorkflowRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface GetWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.GetWorkflowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workflow which information should be retrieved.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the workflow which information should be retrieved.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * 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/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequest.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequest.java new file mode 100644 index 000000000000..fe87a0849120 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequest.java @@ -0,0 +1,1342 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Request for the
+ * [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.ListWorkflowsRequest} + */ +public final class ListWorkflowsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.ListWorkflowsRequest) + ListWorkflowsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkflowsRequest.newBuilder() to construct. + private ListWorkflowsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkflowsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkflowsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListWorkflowsRequest( + 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 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.ListWorkflowsRequest.class, + com.google.cloud.workflows.v1.ListWorkflowsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Project and location from which the workflows should be listed.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * 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. Project and location from which the workflows should be listed.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * 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 workflows to return per call. The service may return
+   * fewer than this value. If the value is not specified, a default value of
+   * 500 will be used. The maximum permitted value is 1000 and values greater
+   * than 1000 will be coerced down to 1000.
+   * 
+ * + * 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 `ListWorkflows` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListWorkflows` 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 `ListWorkflows` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListWorkflows` 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 FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * Filter to restrict results to specific workflows.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + 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(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Filter to restrict results to specific workflows.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * Comma-separated list of fields that that specify the order of the results.
+   * Default sorting order for a field is ascending. To specify descending order
+   * for a field, append a " desc" suffix.
+   * If not specified, the results will be returned in an unspecified order.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Comma-separated list of fields that that specify the order of the results.
+   * Default sorting order for a field is ascending. To specify descending order
+   * for a field, append a " desc" suffix.
+   * If not specified, the results will be returned in an unspecified order.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = 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 (!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 (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + 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 (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!getOrderByBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + 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.v1.ListWorkflowsRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.ListWorkflowsRequest other = + (com.google.cloud.workflows.v1.ListWorkflowsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest 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.v1.ListWorkflowsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest 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.v1.ListWorkflowsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest 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.v1.ListWorkflowsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest 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.v1.ListWorkflowsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest 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.v1.ListWorkflowsRequest 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
+   * [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.ListWorkflowsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.ListWorkflowsRequest) + com.google.cloud.workflows.v1.ListWorkflowsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.ListWorkflowsRequest.class, + com.google.cloud.workflows.v1.ListWorkflowsRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.ListWorkflowsRequest.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_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.ListWorkflowsRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.ListWorkflowsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.ListWorkflowsRequest build() { + com.google.cloud.workflows.v1.ListWorkflowsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.ListWorkflowsRequest buildPartial() { + com.google.cloud.workflows.v1.ListWorkflowsRequest result = + new com.google.cloud.workflows.v1.ListWorkflowsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + 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.v1.ListWorkflowsRequest) { + return mergeFrom((com.google.cloud.workflows.v1.ListWorkflowsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.ListWorkflowsRequest other) { + if (other == com.google.cloud.workflows.v1.ListWorkflowsRequest.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.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + 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.v1.ListWorkflowsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1.ListWorkflowsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Project and location from which the workflows should be listed.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location from which the workflows should be listed.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location from which the workflows should be listed.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location from which the workflows should be listed.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * 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. Project and location from which the workflows should be listed.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * 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 workflows to return per call. The service may return
+     * fewer than this value. If the value is not specified, a default value of
+     * 500 will be used. The maximum permitted value is 1000 and values greater
+     * than 1000 will be coerced down to 1000.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of workflows to return per call. The service may return
+     * fewer than this value. If the value is not specified, a default value of
+     * 500 will be used. The maximum permitted value is 1000 and values greater
+     * than 1000 will be coerced down to 1000.
+     * 
+ * + * 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 workflows to return per call. The service may return
+     * fewer than this value. If the value is not specified, a default value of
+     * 500 will be used. The maximum permitted value is 1000 and values greater
+     * than 1000 will be coerced down to 1000.
+     * 
+ * + * 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 `ListWorkflows` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListWorkflows` 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 `ListWorkflows` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListWorkflows` 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 `ListWorkflows` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListWorkflows` 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 `ListWorkflows` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListWorkflows` 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 `ListWorkflows` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListWorkflows` 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 java.lang.Object filter_ = ""; + /** + * + * + *
+     * Filter to restrict results to specific workflows.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Filter to restrict results to specific workflows.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Filter to restrict results to specific workflows.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Filter to restrict results to specific workflows.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * Filter to restrict results to specific workflows.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Comma-separated list of fields that that specify the order of the results.
+     * Default sorting order for a field is ascending. To specify descending order
+     * for a field, append a " desc" suffix.
+     * If not specified, the results will be returned in an unspecified order.
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Comma-separated list of fields that that specify the order of the results.
+     * Default sorting order for a field is ascending. To specify descending order
+     * for a field, append a " desc" suffix.
+     * If not specified, the results will be returned in an unspecified order.
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Comma-separated list of fields that that specify the order of the results.
+     * Default sorting order for a field is ascending. To specify descending order
+     * for a field, append a " desc" suffix.
+     * If not specified, the results will be returned in an unspecified order.
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Comma-separated list of fields that that specify the order of the results.
+     * Default sorting order for a field is ascending. To specify descending order
+     * for a field, append a " desc" suffix.
+     * If not specified, the results will be returned in an unspecified order.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * Comma-separated list of fields that that specify the order of the results.
+     * Default sorting order for a field is ascending. To specify descending order
+     * for a field, append a " desc" suffix.
+     * If not specified, the results will be returned in an unspecified order.
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = 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.v1.ListWorkflowsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.ListWorkflowsRequest) + private static final com.google.cloud.workflows.v1.ListWorkflowsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.ListWorkflowsRequest(); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkflowsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListWorkflowsRequest(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.v1.ListWorkflowsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequestOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequestOrBuilder.java new file mode 100644 index 000000000000..9be14698a386 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsRequestOrBuilder.java @@ -0,0 +1,159 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface ListWorkflowsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.ListWorkflowsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Project and location from which the workflows should be listed.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Project and location from which the workflows should be listed.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * 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 workflows to return per call. The service may return
+   * fewer than this value. If the value is not specified, a default value of
+   * 500 will be used. The maximum permitted value is 1000 and values greater
+   * than 1000 will be coerced down to 1000.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListWorkflows` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListWorkflows` 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 `ListWorkflows` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListWorkflows` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Filter to restrict results to specific workflows.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Filter to restrict results to specific workflows.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Comma-separated list of fields that that specify the order of the results.
+   * Default sorting order for a field is ascending. To specify descending order
+   * for a field, append a " desc" suffix.
+   * If not specified, the results will be returned in an unspecified order.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Comma-separated list of fields that that specify the order of the results.
+   * Default sorting order for a field is ascending. To specify descending order
+   * for a field, append a " desc" suffix.
+   * If not specified, the results will be returned in an unspecified order.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponse.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponse.java new file mode 100644 index 000000000000..005233d67099 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponse.java @@ -0,0 +1,1415 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Response for the
+ * [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.ListWorkflowsResponse} + */ +public final class ListWorkflowsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.ListWorkflowsResponse) + ListWorkflowsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListWorkflowsResponse.newBuilder() to construct. + private ListWorkflowsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListWorkflowsResponse() { + workflows_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListWorkflowsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListWorkflowsResponse( + 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)) { + workflows_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + workflows_.add( + input.readMessage( + com.google.cloud.workflows.v1.Workflow.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(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)) { + workflows_ = java.util.Collections.unmodifiableList(workflows_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.ListWorkflowsResponse.class, + com.google.cloud.workflows.v1.ListWorkflowsResponse.Builder.class); + } + + public static final int WORKFLOWS_FIELD_NUMBER = 1; + private java.util.List workflows_; + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + @java.lang.Override + public java.util.List getWorkflowsList() { + return workflows_; + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + @java.lang.Override + public java.util.List + getWorkflowsOrBuilderList() { + return workflows_; + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + @java.lang.Override + public int getWorkflowsCount() { + return workflows_.size(); + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow getWorkflows(int index) { + return workflows_.get(index); + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowsOrBuilder(int index) { + return workflows_.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; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + 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 < workflows_.size(); i++) { + output.writeMessage(1, workflows_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < workflows_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, workflows_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + 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.v1.ListWorkflowsResponse)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.ListWorkflowsResponse other = + (com.google.cloud.workflows.v1.ListWorkflowsResponse) obj; + + if (!getWorkflowsList().equals(other.getWorkflowsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) 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 (getWorkflowsCount() > 0) { + hash = (37 * hash) + WORKFLOWS_FIELD_NUMBER; + hash = (53 * hash) + getWorkflowsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse 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.v1.ListWorkflowsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse 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.v1.ListWorkflowsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse 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.v1.ListWorkflowsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse 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.v1.ListWorkflowsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse 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.v1.ListWorkflowsResponse 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
+   * [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.ListWorkflowsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.ListWorkflowsResponse) + com.google.cloud.workflows.v1.ListWorkflowsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.ListWorkflowsResponse.class, + com.google.cloud.workflows.v1.ListWorkflowsResponse.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.ListWorkflowsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWorkflowsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (workflowsBuilder_ == null) { + workflows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + workflowsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.ListWorkflowsResponse getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.ListWorkflowsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.ListWorkflowsResponse build() { + com.google.cloud.workflows.v1.ListWorkflowsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.ListWorkflowsResponse buildPartial() { + com.google.cloud.workflows.v1.ListWorkflowsResponse result = + new com.google.cloud.workflows.v1.ListWorkflowsResponse(this); + int from_bitField0_ = bitField0_; + if (workflowsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + workflows_ = java.util.Collections.unmodifiableList(workflows_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.workflows_ = workflows_; + } else { + result.workflows_ = workflowsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + 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.v1.ListWorkflowsResponse) { + return mergeFrom((com.google.cloud.workflows.v1.ListWorkflowsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.ListWorkflowsResponse other) { + if (other == com.google.cloud.workflows.v1.ListWorkflowsResponse.getDefaultInstance()) + return this; + if (workflowsBuilder_ == null) { + if (!other.workflows_.isEmpty()) { + if (workflows_.isEmpty()) { + workflows_ = other.workflows_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWorkflowsIsMutable(); + workflows_.addAll(other.workflows_); + } + onChanged(); + } + } else { + if (!other.workflows_.isEmpty()) { + if (workflowsBuilder_.isEmpty()) { + workflowsBuilder_.dispose(); + workflowsBuilder_ = null; + workflows_ = other.workflows_; + bitField0_ = (bitField0_ & ~0x00000001); + workflowsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWorkflowsFieldBuilder() + : null; + } else { + workflowsBuilder_.addAllMessages(other.workflows_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + 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.v1.ListWorkflowsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1.ListWorkflowsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List workflows_ = + java.util.Collections.emptyList(); + + private void ensureWorkflowsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + workflows_ = new java.util.ArrayList(workflows_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder> + workflowsBuilder_; + + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public java.util.List getWorkflowsList() { + if (workflowsBuilder_ == null) { + return java.util.Collections.unmodifiableList(workflows_); + } else { + return workflowsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public int getWorkflowsCount() { + if (workflowsBuilder_ == null) { + return workflows_.size(); + } else { + return workflowsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1.Workflow getWorkflows(int index) { + if (workflowsBuilder_ == null) { + return workflows_.get(index); + } else { + return workflowsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder setWorkflows(int index, com.google.cloud.workflows.v1.Workflow value) { + if (workflowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkflowsIsMutable(); + workflows_.set(index, value); + onChanged(); + } else { + workflowsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder setWorkflows( + int index, com.google.cloud.workflows.v1.Workflow.Builder builderForValue) { + if (workflowsBuilder_ == null) { + ensureWorkflowsIsMutable(); + workflows_.set(index, builderForValue.build()); + onChanged(); + } else { + workflowsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder addWorkflows(com.google.cloud.workflows.v1.Workflow value) { + if (workflowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkflowsIsMutable(); + workflows_.add(value); + onChanged(); + } else { + workflowsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder addWorkflows(int index, com.google.cloud.workflows.v1.Workflow value) { + if (workflowsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWorkflowsIsMutable(); + workflows_.add(index, value); + onChanged(); + } else { + workflowsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder addWorkflows(com.google.cloud.workflows.v1.Workflow.Builder builderForValue) { + if (workflowsBuilder_ == null) { + ensureWorkflowsIsMutable(); + workflows_.add(builderForValue.build()); + onChanged(); + } else { + workflowsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder addWorkflows( + int index, com.google.cloud.workflows.v1.Workflow.Builder builderForValue) { + if (workflowsBuilder_ == null) { + ensureWorkflowsIsMutable(); + workflows_.add(index, builderForValue.build()); + onChanged(); + } else { + workflowsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder addAllWorkflows( + java.lang.Iterable values) { + if (workflowsBuilder_ == null) { + ensureWorkflowsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, workflows_); + onChanged(); + } else { + workflowsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder clearWorkflows() { + if (workflowsBuilder_ == null) { + workflows_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + workflowsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public Builder removeWorkflows(int index) { + if (workflowsBuilder_ == null) { + ensureWorkflowsIsMutable(); + workflows_.remove(index); + onChanged(); + } else { + workflowsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1.Workflow.Builder getWorkflowsBuilder(int index) { + return getWorkflowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowsOrBuilder(int index) { + if (workflowsBuilder_ == null) { + return workflows_.get(index); + } else { + return workflowsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public java.util.List + getWorkflowsOrBuilderList() { + if (workflowsBuilder_ != null) { + return workflowsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(workflows_); + } + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1.Workflow.Builder addWorkflowsBuilder() { + return getWorkflowsFieldBuilder() + .addBuilder(com.google.cloud.workflows.v1.Workflow.getDefaultInstance()); + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1.Workflow.Builder addWorkflowsBuilder(int index) { + return getWorkflowsFieldBuilder() + .addBuilder(index, com.google.cloud.workflows.v1.Workflow.getDefaultInstance()); + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + public java.util.List + getWorkflowsBuilderList() { + return getWorkflowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder> + getWorkflowsFieldBuilder() { + if (workflowsBuilder_ == null) { + workflowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder>( + workflows_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + workflows_ = null; + } + return workflowsBuilder_; + } + + 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; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(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.v1.ListWorkflowsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.ListWorkflowsResponse) + private static final com.google.cloud.workflows.v1.ListWorkflowsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.ListWorkflowsResponse(); + } + + public static com.google.cloud.workflows.v1.ListWorkflowsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListWorkflowsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListWorkflowsResponse(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.v1.ListWorkflowsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponseOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponseOrBuilder.java new file mode 100644 index 000000000000..334b3496baa4 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/ListWorkflowsResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface ListWorkflowsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.ListWorkflowsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + java.util.List getWorkflowsList(); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + com.google.cloud.workflows.v1.Workflow getWorkflows(int index); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + int getWorkflowsCount(); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + java.util.List + getWorkflowsOrBuilderList(); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1.Workflow workflows = 1; + */ + com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowsOrBuilder(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(); + + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/LocationName.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/LocationName.java new file mode 100644 index 000000000000..a1c8ad5e1703 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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.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 LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + 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 (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.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); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadata.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadata.java new file mode 100644 index 000000000000..eb5ff41bfa8d --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadata.java @@ -0,0 +1,1533 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + 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: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + 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 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.OperationMetadata.class, + com.google.cloud.workflows.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int API_VERSION_FIELD_NUMBER = 5; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 5; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 5; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, apiVersion_); + } + 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.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.OperationMetadata other = + (com.google.cloud.workflows.v1.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getApiVersion().equals(other.getApiVersion())) 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 (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.v1.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.OperationMetadata 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.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.OperationMetadata 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.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.OperationMetadata 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.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.OperationMetadata 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.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.OperationMetadata 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.v1.OperationMetadata 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; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.OperationMetadata) + com.google.cloud.workflows.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.OperationMetadata.class, + com.google.cloud.workflows.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.OperationMetadata.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(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.OperationMetadata build() { + com.google.cloud.workflows.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.OperationMetadata buildPartial() { + com.google.cloud.workflows.v1.OperationMetadata result = + new com.google.cloud.workflows.v1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.apiVersion_ = apiVersion_; + 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.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.workflows.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.OperationMetadata other) { + if (other == com.google.cloud.workflows.v1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + 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.v1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.workflows.v1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + 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_; + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @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(); + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + 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; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + 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; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + 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 java.lang.Object target_ = ""; + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 5; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 5; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 5; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 5; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 5; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = 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.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.OperationMetadata) + private static final com.google.cloud.workflows.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.OperationMetadata(); + } + + public static com.google.cloud.workflows.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(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.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadataOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..7a05e53152e3 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,170 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 5; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 5; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequest.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequest.java new file mode 100644 index 000000000000..72ac54757e25 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequest.java @@ -0,0 +1,1045 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Request for the
+ * [UpdateWorkflow][google.cloud.workflows.v1.Workflows.UpdateWorkflow]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.UpdateWorkflowRequest} + */ +public final class UpdateWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.UpdateWorkflowRequest) + UpdateWorkflowRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateWorkflowRequest.newBuilder() to construct. + private UpdateWorkflowRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateWorkflowRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateWorkflowRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateWorkflowRequest( + 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: + { + com.google.cloud.workflows.v1.Workflow.Builder subBuilder = null; + if (workflow_ != null) { + subBuilder = workflow_.toBuilder(); + } + workflow_ = + input.readMessage( + com.google.cloud.workflows.v1.Workflow.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(workflow_); + workflow_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.UpdateWorkflowRequest.class, + com.google.cloud.workflows.v1.UpdateWorkflowRequest.Builder.class); + } + + public static final int WORKFLOW_FIELD_NUMBER = 1; + private com.google.cloud.workflows.v1.Workflow workflow_; + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workflow field is set. + */ + @java.lang.Override + public boolean hasWorkflow() { + return workflow_ != null; + } + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow getWorkflow() { + return workflow_ == null + ? com.google.cloud.workflows.v1.Workflow.getDefaultInstance() + : workflow_; + } + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowOrBuilder() { + return getWorkflow(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * List of fields to be updated. If not present, the entire workflow
+   * will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * List of fields to be updated. If not present, the entire workflow
+   * will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * List of fields to be updated. If not present, the entire workflow
+   * will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (workflow_ != null) { + output.writeMessage(1, getWorkflow()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (workflow_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWorkflow()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.v1.UpdateWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.UpdateWorkflowRequest other = + (com.google.cloud.workflows.v1.UpdateWorkflowRequest) obj; + + if (hasWorkflow() != other.hasWorkflow()) return false; + if (hasWorkflow()) { + if (!getWorkflow().equals(other.getWorkflow())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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 (hasWorkflow()) { + hash = (37 * hash) + WORKFLOW_FIELD_NUMBER; + hash = (53 * hash) + getWorkflow().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest 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.v1.UpdateWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest 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.v1.UpdateWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest 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.v1.UpdateWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest 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.v1.UpdateWorkflowRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest 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.v1.UpdateWorkflowRequest 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
+   * [UpdateWorkflow][google.cloud.workflows.v1.Workflows.UpdateWorkflow]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.UpdateWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.UpdateWorkflowRequest) + com.google.cloud.workflows.v1.UpdateWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.UpdateWorkflowRequest.class, + com.google.cloud.workflows.v1.UpdateWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.UpdateWorkflowRequest.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(); + if (workflowBuilder_ == null) { + workflow_ = null; + } else { + workflow_ = null; + workflowBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.UpdateWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.UpdateWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.UpdateWorkflowRequest build() { + com.google.cloud.workflows.v1.UpdateWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.UpdateWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1.UpdateWorkflowRequest result = + new com.google.cloud.workflows.v1.UpdateWorkflowRequest(this); + if (workflowBuilder_ == null) { + result.workflow_ = workflow_; + } else { + result.workflow_ = workflowBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.v1.UpdateWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1.UpdateWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.UpdateWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1.UpdateWorkflowRequest.getDefaultInstance()) + return this; + if (other.hasWorkflow()) { + mergeWorkflow(other.getWorkflow()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.v1.UpdateWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1.UpdateWorkflowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.workflows.v1.Workflow workflow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder> + workflowBuilder_; + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workflow field is set. + */ + public boolean hasWorkflow() { + return workflowBuilder_ != null || workflow_ != null; + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + public com.google.cloud.workflows.v1.Workflow getWorkflow() { + if (workflowBuilder_ == null) { + return workflow_ == null + ? com.google.cloud.workflows.v1.Workflow.getDefaultInstance() + : workflow_; + } else { + return workflowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1.Workflow value) { + if (workflowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + workflow_ = value; + onChanged(); + } else { + workflowBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1.Workflow.Builder builderForValue) { + if (workflowBuilder_ == null) { + workflow_ = builderForValue.build(); + onChanged(); + } else { + workflowBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkflow(com.google.cloud.workflows.v1.Workflow value) { + if (workflowBuilder_ == null) { + if (workflow_ != null) { + workflow_ = + com.google.cloud.workflows.v1.Workflow.newBuilder(workflow_) + .mergeFrom(value) + .buildPartial(); + } else { + workflow_ = value; + } + onChanged(); + } else { + workflowBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearWorkflow() { + if (workflowBuilder_ == null) { + workflow_ = null; + onChanged(); + } else { + workflow_ = null; + workflowBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1.Workflow.Builder getWorkflowBuilder() { + + onChanged(); + return getWorkflowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowOrBuilder() { + if (workflowBuilder_ != null) { + return workflowBuilder_.getMessageOrBuilder(); + } else { + return workflow_ == null + ? com.google.cloud.workflows.v1.Workflow.getDefaultInstance() + : workflow_; + } + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder> + getWorkflowFieldBuilder() { + if (workflowBuilder_ == null) { + workflowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1.Workflow, + com.google.cloud.workflows.v1.Workflow.Builder, + com.google.cloud.workflows.v1.WorkflowOrBuilder>( + getWorkflow(), getParentForChildren(), isClean()); + workflow_ = null; + } + return workflowBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * List of fields to be updated. If not present, the entire workflow
+     * will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.v1.UpdateWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.UpdateWorkflowRequest) + private static final com.google.cloud.workflows.v1.UpdateWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.UpdateWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1.UpdateWorkflowRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateWorkflowRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateWorkflowRequest(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.v1.UpdateWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequestOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequestOrBuilder.java new file mode 100644 index 000000000000..7427139de4e9 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/UpdateWorkflowRequestOrBuilder.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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface UpdateWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.UpdateWorkflowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the workflow field is set. + */ + boolean hasWorkflow(); + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + com.google.cloud.workflows.v1.Workflow getWorkflow(); + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workflows.v1.WorkflowOrBuilder getWorkflowOrBuilder(); + + /** + * + * + *
+   * List of fields to be updated. If not present, the entire workflow
+   * will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * List of fields to be updated. If not present, the entire workflow
+   * will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * List of fields to be updated. If not present, the entire workflow
+   * will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/Workflow.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/Workflow.java new file mode 100644 index 000000000000..dc158e104eae --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/Workflow.java @@ -0,0 +1,3172 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +/** + * + * + *
+ * Workflow program to be executed by Workflows.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.Workflow} + */ +public final class Workflow extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1.Workflow) + WorkflowOrBuilder { + private static final long serialVersionUID = 0L; + // Use Workflow.newBuilder() to construct. + private Workflow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Workflow() { + name_ = ""; + description_ = ""; + state_ = 0; + revisionId_ = ""; + serviceAccount_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Workflow(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Workflow( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + revisionId_ = s; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (revisionCreateTime_ != null) { + subBuilder = revisionCreateTime_.toBuilder(); + } + revisionCreateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(revisionCreateTime_); + revisionCreateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccount_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCodeCase_ = 10; + sourceCode_ = 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.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_Workflow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_Workflow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.Workflow.class, + com.google.cloud.workflows.v1.Workflow.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of workflow deployment. More states may be
+   * added in the future.
+   * 
+ * + * Protobuf enum {@code google.cloud.workflows.v1.Workflow.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The workflow has been deployed successfully and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The workflow has been deployed successfully and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + + 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; + 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.v1.Workflow.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.v1.Workflow.State) + } + + private int sourceCodeCase_ = 0; + private java.lang.Object sourceCode_; + + public enum SourceCodeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SOURCE_CONTENTS(10), + SOURCECODE_NOT_SET(0); + private final int value; + + private SourceCodeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCodeCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCodeCase forNumber(int value) { + switch (value) { + case 10: + return SOURCE_CONTENTS; + case 0: + return SOURCECODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCodeCase getSourceCodeCase() { + return SourceCodeCase.forNumber(sourceCodeCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the workflow.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+   * The resource name of the workflow.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * string name = 1; + * + * @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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Description of the workflow provided by the user.
+   * Must be at most 1000 unicode characters long.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Description of the workflow provided by the user.
+   * Must be at most 1000 unicode characters long.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+   * Output only. State of the workflow deployment.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.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. State of the workflow deployment.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.v1.Workflow.State result = + com.google.cloud.workflows.v1.Workflow.State.valueOf(state_); + return result == null ? com.google.cloud.workflows.v1.Workflow.State.UNRECOGNIZED : result; + } + + public static final int REVISION_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object revisionId_; + /** + * + * + *
+   * Output only. The revision of the workflow.
+   * A new revision of a workflow is created as a result of updating the
+   * following fields of a workflow:
+   * - `source_code`
+   * - `service_account`
+   * The format is "000001-a4d", where the first 6 characters define
+   * the zero-padded revision ordinal number. They are followed by a hyphen and
+   * 3 hexadecimal random characters.
+   * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revisionId. + */ + @java.lang.Override + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + 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(); + revisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The revision of the workflow.
+   * A new revision of a workflow is created as a result of updating the
+   * following fields of a workflow:
+   * - `source_code`
+   * - `service_account`
+   * The format is "000001-a4d", where the first 6 characters define
+   * the zero-padded revision ordinal number. They are followed by a hyphen and
+   * 3 hexadecimal random characters.
+   * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp of when the workflow was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp of when the workflow was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The timestamp of when the workflow was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of the workflow.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of the workflow.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of the workflow.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int REVISION_CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp revisionCreateTime_; + /** + * + * + *
+   * Output only. The timestamp that the latest revision of the workflow
+   * was created.
+   * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the revisionCreateTime field is set. + */ + @java.lang.Override + public boolean hasRevisionCreateTime() { + return revisionCreateTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp that the latest revision of the workflow
+   * was created.
+   * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The revisionCreateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRevisionCreateTime() { + return revisionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : revisionCreateTime_; + } + /** + * + * + *
+   * Output only. The timestamp that the latest revision of the workflow
+   * was created.
+   * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder() { + return getRevisionCreateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_Workflow_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 9; + private volatile java.lang.Object serviceAccount_; + /** + * + * + *
+   * Name of the service account associated with the latest workflow version.
+   * This service account represents the identity of the workflow and determines
+   * what permissions the workflow has.
+   * Format: projects/{project}/serviceAccounts/{account}
+   * Using `-` as a wildcard for the `{project}` will infer the project from
+   * the account. The `{account}` value can be the `email` address or the
+   * `unique_id` of the service account.
+   * If not provided, workflow will use the project's default service account.
+   * Modifying this field for an existing workflow results in a new workflow
+   * revision.
+   * 
+ * + * string service_account = 9; + * + * @return The serviceAccount. + */ + @java.lang.Override + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + 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(); + serviceAccount_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the service account associated with the latest workflow version.
+   * This service account represents the identity of the workflow and determines
+   * what permissions the workflow has.
+   * Format: projects/{project}/serviceAccounts/{account}
+   * Using `-` as a wildcard for the `{project}` will infer the project from
+   * the account. The `{account}` value can be the `email` address or the
+   * `unique_id` of the service account.
+   * If not provided, workflow will use the project's default service account.
+   * Modifying this field for an existing workflow results in a new workflow
+   * revision.
+   * 
+ * + * string service_account = 9; + * + * @return The bytes for serviceAccount. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_CONTENTS_FIELD_NUMBER = 10; + /** + * + * + *
+   * Workflow code to be executed. The size limit is 32KB.
+   * 
+ * + * string source_contents = 10; + * + * @return Whether the sourceContents field is set. + */ + public boolean hasSourceContents() { + return sourceCodeCase_ == 10; + } + /** + * + * + *
+   * Workflow code to be executed. The size limit is 32KB.
+   * 
+ * + * string source_contents = 10; + * + * @return The sourceContents. + */ + public java.lang.String getSourceContents() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 10) { + ref = sourceCode_; + } + 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(); + if (sourceCodeCase_ == 10) { + sourceCode_ = s; + } + return s; + } + } + /** + * + * + *
+   * Workflow code to be executed. The size limit is 32KB.
+   * 
+ * + * string source_contents = 10; + * + * @return The bytes for sourceContents. + */ + public com.google.protobuf.ByteString getSourceContentsBytes() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 10) { + ref = sourceCode_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCodeCase_ == 10) { + sourceCode_ = 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 (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (state_ != com.google.cloud.workflows.v1.Workflow.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (!getRevisionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, revisionId_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (revisionCreateTime_ != null) { + output.writeMessage(7, getRevisionCreateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + if (!getServiceAccountBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, serviceAccount_); + } + if (sourceCodeCase_ == 10) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, sourceCode_); + } + 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 (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (state_ != com.google.cloud.workflows.v1.Workflow.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (!getRevisionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, revisionId_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (revisionCreateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getRevisionCreateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + if (!getServiceAccountBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, serviceAccount_); + } + if (sourceCodeCase_ == 10) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, sourceCode_); + } + 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.v1.Workflow)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1.Workflow other = (com.google.cloud.workflows.v1.Workflow) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (state_ != other.state_) return false; + if (!getRevisionId().equals(other.getRevisionId())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasRevisionCreateTime() != other.hasRevisionCreateTime()) return false; + if (hasRevisionCreateTime()) { + if (!getRevisionCreateTime().equals(other.getRevisionCreateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getServiceAccount().equals(other.getServiceAccount())) return false; + if (!getSourceCodeCase().equals(other.getSourceCodeCase())) return false; + switch (sourceCodeCase_) { + case 10: + if (!getSourceContents().equals(other.getSourceContents())) return false; + break; + case 0: + default: + } + 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) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasRevisionCreateTime()) { + hash = (37 * hash) + REVISION_CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRevisionCreateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccount().hashCode(); + switch (sourceCodeCase_) { + case 10: + hash = (37 * hash) + SOURCE_CONTENTS_FIELD_NUMBER; + hash = (53 * hash) + getSourceContents().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.v1.Workflow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.Workflow 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.v1.Workflow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.Workflow 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.v1.Workflow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1.Workflow parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.v1.Workflow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.Workflow 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.v1.Workflow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.Workflow 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.v1.Workflow parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1.Workflow 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.v1.Workflow 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; + } + /** + * + * + *
+   * Workflow program to be executed by Workflows.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1.Workflow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1.Workflow) + com.google.cloud.workflows.v1.WorkflowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_Workflow_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_Workflow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1.Workflow.class, + com.google.cloud.workflows.v1.Workflow.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1.Workflow.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_ = ""; + + description_ = ""; + + state_ = 0; + + revisionId_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + if (revisionCreateTimeBuilder_ == null) { + revisionCreateTime_ = null; + } else { + revisionCreateTime_ = null; + revisionCreateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + serviceAccount_ = ""; + + sourceCodeCase_ = 0; + sourceCode_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.v1.WorkflowsProto + .internal_static_google_cloud_workflows_v1_Workflow_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow getDefaultInstanceForType() { + return com.google.cloud.workflows.v1.Workflow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow build() { + com.google.cloud.workflows.v1.Workflow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow buildPartial() { + com.google.cloud.workflows.v1.Workflow result = + new com.google.cloud.workflows.v1.Workflow(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + result.state_ = state_; + result.revisionId_ = revisionId_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (revisionCreateTimeBuilder_ == null) { + result.revisionCreateTime_ = revisionCreateTime_; + } else { + result.revisionCreateTime_ = revisionCreateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.serviceAccount_ = serviceAccount_; + if (sourceCodeCase_ == 10) { + result.sourceCode_ = sourceCode_; + } + result.sourceCodeCase_ = sourceCodeCase_; + 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.v1.Workflow) { + return mergeFrom((com.google.cloud.workflows.v1.Workflow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1.Workflow other) { + if (other == com.google.cloud.workflows.v1.Workflow.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasRevisionCreateTime()) { + mergeRevisionCreateTime(other.getRevisionCreateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (!other.getServiceAccount().isEmpty()) { + serviceAccount_ = other.serviceAccount_; + onChanged(); + } + switch (other.getSourceCodeCase()) { + case SOURCE_CONTENTS: + { + sourceCodeCase_ = 10; + sourceCode_ = other.sourceCode_; + onChanged(); + break; + } + case SOURCECODE_NOT_SET: + { + break; + } + } + 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.v1.Workflow parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.workflows.v1.Workflow) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCodeCase_ = 0; + private java.lang.Object sourceCode_; + + public SourceCodeCase getSourceCodeCase() { + return SourceCodeCase.forNumber(sourceCodeCase_); + } + + public Builder clearSourceCode() { + sourceCodeCase_ = 0; + sourceCode_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the workflow.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The resource name of the workflow.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * string name = 1; + * + * @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; + } + } + /** + * + * + *
+     * The resource name of the workflow.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * string name = 1; + * + * @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; + } + /** + * + * + *
+     * The resource name of the workflow.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the workflow.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * string name = 1; + * + * @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 java.lang.Object description_ = ""; + /** + * + * + *
+     * Description of the workflow provided by the user.
+     * Must be at most 1000 unicode characters long.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Description of the workflow provided by the user.
+     * Must be at most 1000 unicode characters long.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Description of the workflow provided by the user.
+     * Must be at most 1000 unicode characters long.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the workflow provided by the user.
+     * Must be at most 1000 unicode characters long.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Description of the workflow provided by the user.
+     * Must be at most 1000 unicode characters long.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the workflow deployment.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.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. State of the workflow deployment.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.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. State of the workflow deployment.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.v1.Workflow.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.v1.Workflow.State result = + com.google.cloud.workflows.v1.Workflow.State.valueOf(state_); + return result == null ? com.google.cloud.workflows.v1.Workflow.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. State of the workflow deployment.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.workflows.v1.Workflow.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the workflow deployment.
+     * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object revisionId_ = ""; + /** + * + * + *
+     * Output only. The revision of the workflow.
+     * A new revision of a workflow is created as a result of updating the
+     * following fields of a workflow:
+     * - `source_code`
+     * - `service_account`
+     * The format is "000001-a4d", where the first 6 characters define
+     * the zero-padded revision ordinal number. They are followed by a hyphen and
+     * 3 hexadecimal random characters.
+     * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revisionId. + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The revision of the workflow.
+     * A new revision of a workflow is created as a result of updating the
+     * following fields of a workflow:
+     * - `source_code`
+     * - `service_account`
+     * The format is "000001-a4d", where the first 6 characters define
+     * the zero-padded revision ordinal number. They are followed by a hyphen and
+     * 3 hexadecimal random characters.
+     * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revisionId. + */ + public com.google.protobuf.ByteString getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The revision of the workflow.
+     * A new revision of a workflow is created as a result of updating the
+     * following fields of a workflow:
+     * - `source_code`
+     * - `service_account`
+     * The format is "000001-a4d", where the first 6 characters define
+     * the zero-padded revision ordinal number. They are followed by a hyphen and
+     * 3 hexadecimal random characters.
+     * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revisionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The revision of the workflow.
+     * A new revision of a workflow is created as a result of updating the
+     * following fields of a workflow:
+     * - `source_code`
+     * - `service_account`
+     * The format is "000001-a4d", where the first 6 characters define
+     * the zero-padded revision ordinal number. They are followed by a hyphen and
+     * 3 hexadecimal random characters.
+     * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRevisionId() { + + revisionId_ = getDefaultInstance().getRevisionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The revision of the workflow.
+     * A new revision of a workflow is created as a result of updating the
+     * following fields of a workflow:
+     * - `source_code`
+     * - `service_account`
+     * The format is "000001-a4d", where the first 6 characters define
+     * the zero-padded revision ordinal number. They are followed by a hyphen and
+     * 3 hexadecimal random characters.
+     * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for revisionId to set. + * @return This builder for chaining. + */ + public Builder setRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revisionId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp of when the workflow was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last update timestamp of the workflow.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.Timestamp revisionCreateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + revisionCreateTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the revisionCreateTime field is set. + */ + public boolean hasRevisionCreateTime() { + return revisionCreateTimeBuilder_ != null || revisionCreateTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The revisionCreateTime. + */ + public com.google.protobuf.Timestamp getRevisionCreateTime() { + if (revisionCreateTimeBuilder_ == null) { + return revisionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : revisionCreateTime_; + } else { + return revisionCreateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRevisionCreateTime(com.google.protobuf.Timestamp value) { + if (revisionCreateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + revisionCreateTime_ = value; + onChanged(); + } else { + revisionCreateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setRevisionCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (revisionCreateTimeBuilder_ == null) { + revisionCreateTime_ = builderForValue.build(); + onChanged(); + } else { + revisionCreateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeRevisionCreateTime(com.google.protobuf.Timestamp value) { + if (revisionCreateTimeBuilder_ == null) { + if (revisionCreateTime_ != null) { + revisionCreateTime_ = + com.google.protobuf.Timestamp.newBuilder(revisionCreateTime_) + .mergeFrom(value) + .buildPartial(); + } else { + revisionCreateTime_ = value; + } + onChanged(); + } else { + revisionCreateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearRevisionCreateTime() { + if (revisionCreateTimeBuilder_ == null) { + revisionCreateTime_ = null; + onChanged(); + } else { + revisionCreateTime_ = null; + revisionCreateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getRevisionCreateTimeBuilder() { + + onChanged(); + return getRevisionCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder() { + if (revisionCreateTimeBuilder_ != null) { + return revisionCreateTimeBuilder_.getMessageOrBuilder(); + } else { + return revisionCreateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : revisionCreateTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp that the latest revision of the workflow
+     * was created.
+     * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRevisionCreateTimeFieldBuilder() { + if (revisionCreateTimeBuilder_ == null) { + revisionCreateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRevisionCreateTime(), getParentForChildren(), isClean()); + revisionCreateTime_ = null; + } + return revisionCreateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this workflow.
+     * Labels can contain at most 64 entries. Keys and values can be no longer
+     * than 63 characters and can only contain lowercase letters, numeric
+     * characters, underscores and dashes. Label keys must start with a letter.
+     * International characters are allowed.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object serviceAccount_ = ""; + /** + * + * + *
+     * Name of the service account associated with the latest workflow version.
+     * This service account represents the identity of the workflow and determines
+     * what permissions the workflow has.
+     * Format: projects/{project}/serviceAccounts/{account}
+     * Using `-` as a wildcard for the `{project}` will infer the project from
+     * the account. The `{account}` value can be the `email` address or the
+     * `unique_id` of the service account.
+     * If not provided, workflow will use the project's default service account.
+     * Modifying this field for an existing workflow results in a new workflow
+     * revision.
+     * 
+ * + * string service_account = 9; + * + * @return The serviceAccount. + */ + public java.lang.String getServiceAccount() { + java.lang.Object ref = serviceAccount_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccount_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the service account associated with the latest workflow version.
+     * This service account represents the identity of the workflow and determines
+     * what permissions the workflow has.
+     * Format: projects/{project}/serviceAccounts/{account}
+     * Using `-` as a wildcard for the `{project}` will infer the project from
+     * the account. The `{account}` value can be the `email` address or the
+     * `unique_id` of the service account.
+     * If not provided, workflow will use the project's default service account.
+     * Modifying this field for an existing workflow results in a new workflow
+     * revision.
+     * 
+ * + * string service_account = 9; + * + * @return The bytes for serviceAccount. + */ + public com.google.protobuf.ByteString getServiceAccountBytes() { + java.lang.Object ref = serviceAccount_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccount_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the service account associated with the latest workflow version.
+     * This service account represents the identity of the workflow and determines
+     * what permissions the workflow has.
+     * Format: projects/{project}/serviceAccounts/{account}
+     * Using `-` as a wildcard for the `{project}` will infer the project from
+     * the account. The `{account}` value can be the `email` address or the
+     * `unique_id` of the service account.
+     * If not provided, workflow will use the project's default service account.
+     * Modifying this field for an existing workflow results in a new workflow
+     * revision.
+     * 
+ * + * string service_account = 9; + * + * @param value The serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccount(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the service account associated with the latest workflow version.
+     * This service account represents the identity of the workflow and determines
+     * what permissions the workflow has.
+     * Format: projects/{project}/serviceAccounts/{account}
+     * Using `-` as a wildcard for the `{project}` will infer the project from
+     * the account. The `{account}` value can be the `email` address or the
+     * `unique_id` of the service account.
+     * If not provided, workflow will use the project's default service account.
+     * Modifying this field for an existing workflow results in a new workflow
+     * revision.
+     * 
+ * + * string service_account = 9; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccount() { + + serviceAccount_ = getDefaultInstance().getServiceAccount(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the service account associated with the latest workflow version.
+     * This service account represents the identity of the workflow and determines
+     * what permissions the workflow has.
+     * Format: projects/{project}/serviceAccounts/{account}
+     * Using `-` as a wildcard for the `{project}` will infer the project from
+     * the account. The `{account}` value can be the `email` address or the
+     * `unique_id` of the service account.
+     * If not provided, workflow will use the project's default service account.
+     * Modifying this field for an existing workflow results in a new workflow
+     * revision.
+     * 
+ * + * string service_account = 9; + * + * @param value The bytes for serviceAccount to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccount_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Workflow code to be executed. The size limit is 32KB.
+     * 
+ * + * string source_contents = 10; + * + * @return Whether the sourceContents field is set. + */ + @java.lang.Override + public boolean hasSourceContents() { + return sourceCodeCase_ == 10; + } + /** + * + * + *
+     * Workflow code to be executed. The size limit is 32KB.
+     * 
+ * + * string source_contents = 10; + * + * @return The sourceContents. + */ + @java.lang.Override + public java.lang.String getSourceContents() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 10) { + ref = sourceCode_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCodeCase_ == 10) { + sourceCode_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Workflow code to be executed. The size limit is 32KB.
+     * 
+ * + * string source_contents = 10; + * + * @return The bytes for sourceContents. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceContentsBytes() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 10) { + ref = sourceCode_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCodeCase_ == 10) { + sourceCode_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Workflow code to be executed. The size limit is 32KB.
+     * 
+ * + * string source_contents = 10; + * + * @param value The sourceContents to set. + * @return This builder for chaining. + */ + public Builder setSourceContents(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCodeCase_ = 10; + sourceCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Workflow code to be executed. The size limit is 32KB.
+     * 
+ * + * string source_contents = 10; + * + * @return This builder for chaining. + */ + public Builder clearSourceContents() { + if (sourceCodeCase_ == 10) { + sourceCodeCase_ = 0; + sourceCode_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Workflow code to be executed. The size limit is 32KB.
+     * 
+ * + * string source_contents = 10; + * + * @param value The bytes for sourceContents to set. + * @return This builder for chaining. + */ + public Builder setSourceContentsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCodeCase_ = 10; + sourceCode_ = 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.v1.Workflow) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1.Workflow) + private static final com.google.cloud.workflows.v1.Workflow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1.Workflow(); + } + + public static com.google.cloud.workflows.v1.Workflow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Workflow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Workflow(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.v1.Workflow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowName.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowName.java new file mode 100644 index 000000000000..d24a35a8e748 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/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.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/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowOrBuilder.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowOrBuilder.java new file mode 100644 index 000000000000..acafeaded3c4 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowOrBuilder.java @@ -0,0 +1,423 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public interface WorkflowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1.Workflow) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the workflow.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the workflow.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Description of the workflow provided by the user.
+   * Must be at most 1000 unicode characters long.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Description of the workflow provided by the user.
+   * Must be at most 1000 unicode characters long.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. State of the workflow deployment.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the workflow deployment.
+   * 
+ * + * + * .google.cloud.workflows.v1.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.workflows.v1.Workflow.State getState(); + + /** + * + * + *
+   * Output only. The revision of the workflow.
+   * A new revision of a workflow is created as a result of updating the
+   * following fields of a workflow:
+   * - `source_code`
+   * - `service_account`
+   * The format is "000001-a4d", where the first 6 characters define
+   * the zero-padded revision ordinal number. They are followed by a hyphen and
+   * 3 hexadecimal random characters.
+   * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revisionId. + */ + java.lang.String getRevisionId(); + /** + * + * + *
+   * Output only. The revision of the workflow.
+   * A new revision of a workflow is created as a result of updating the
+   * following fields of a workflow:
+   * - `source_code`
+   * - `service_account`
+   * The format is "000001-a4d", where the first 6 characters define
+   * the zero-padded revision ordinal number. They are followed by a hyphen and
+   * 3 hexadecimal random characters.
+   * 
+ * + * string revision_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revisionId. + */ + com.google.protobuf.ByteString getRevisionIdBytes(); + + /** + * + * + *
+   * Output only. The timestamp of when the workflow was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp of when the workflow was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp of when the workflow was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the workflow.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of the workflow.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of the workflow.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The timestamp that the latest revision of the workflow
+   * was created.
+   * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the revisionCreateTime field is set. + */ + boolean hasRevisionCreateTime(); + /** + * + * + *
+   * Output only. The timestamp that the latest revision of the workflow
+   * was created.
+   * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The revisionCreateTime. + */ + com.google.protobuf.Timestamp getRevisionCreateTime(); + /** + * + * + *
+   * Output only. The timestamp that the latest revision of the workflow
+   * was created.
+   * 
+ * + * + * .google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getRevisionCreateTimeOrBuilder(); + + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this workflow.
+   * Labels can contain at most 64 entries. Keys and values can be no longer
+   * than 63 characters and can only contain lowercase letters, numeric
+   * characters, underscores and dashes. Label keys must start with a letter.
+   * International characters are allowed.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Name of the service account associated with the latest workflow version.
+   * This service account represents the identity of the workflow and determines
+   * what permissions the workflow has.
+   * Format: projects/{project}/serviceAccounts/{account}
+   * Using `-` as a wildcard for the `{project}` will infer the project from
+   * the account. The `{account}` value can be the `email` address or the
+   * `unique_id` of the service account.
+   * If not provided, workflow will use the project's default service account.
+   * Modifying this field for an existing workflow results in a new workflow
+   * revision.
+   * 
+ * + * string service_account = 9; + * + * @return The serviceAccount. + */ + java.lang.String getServiceAccount(); + /** + * + * + *
+   * Name of the service account associated with the latest workflow version.
+   * This service account represents the identity of the workflow and determines
+   * what permissions the workflow has.
+   * Format: projects/{project}/serviceAccounts/{account}
+   * Using `-` as a wildcard for the `{project}` will infer the project from
+   * the account. The `{account}` value can be the `email` address or the
+   * `unique_id` of the service account.
+   * If not provided, workflow will use the project's default service account.
+   * Modifying this field for an existing workflow results in a new workflow
+   * revision.
+   * 
+ * + * string service_account = 9; + * + * @return The bytes for serviceAccount. + */ + com.google.protobuf.ByteString getServiceAccountBytes(); + + /** + * + * + *
+   * Workflow code to be executed. The size limit is 32KB.
+   * 
+ * + * string source_contents = 10; + * + * @return Whether the sourceContents field is set. + */ + boolean hasSourceContents(); + /** + * + * + *
+   * Workflow code to be executed. The size limit is 32KB.
+   * 
+ * + * string source_contents = 10; + * + * @return The sourceContents. + */ + java.lang.String getSourceContents(); + /** + * + * + *
+   * Workflow code to be executed. The size limit is 32KB.
+   * 
+ * + * string source_contents = 10; + * + * @return The bytes for sourceContents. + */ + com.google.protobuf.ByteString getSourceContentsBytes(); + + public com.google.cloud.workflows.v1.Workflow.SourceCodeCase getSourceCodeCase(); +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsProto.java b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsProto.java new file mode 100644 index 000000000000..5b8d56112644 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/java/com/google/cloud/workflows/v1/WorkflowsProto.java @@ -0,0 +1,269 @@ +/* + * 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/v1/workflows.proto + +package com.google.cloud.workflows.v1; + +public final class WorkflowsProto { + private WorkflowsProto() {} + + 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_v1_Workflow_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_Workflow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_Workflow_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_Workflow_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_GetWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_GetWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/cloud/workflows/v1/workflows.pr" + + "oto\022\031google.cloud.workflows.v1\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\032#google/longru" + + "nning/operations.proto\032 google/protobuf/" + + "field_mask.proto\032\037google/protobuf/timest" + + "amp.proto\"\366\004\n\010Workflow\022\014\n\004name\030\001 \001(\t\022\023\n\013" + + "description\030\002 \001(\t\022=\n\005state\030\003 \001(\0162).googl" + + "e.cloud.workflows.v1.Workflow.StateB\003\340A\003" + + "\022\030\n\013revision_id\030\004 \001(\tB\003\340A\003\0224\n\013create_tim" + + "e\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0224\n\013update_time\030\006 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\022=\n\024revision_create_time\030\007" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022?\n" + + "\006labels\030\010 \003(\0132/.google.cloud.workflows.v" + + "1.Workflow.LabelsEntry\022\027\n\017service_accoun" + + "t\030\t \001(\t\022\031\n\017source_contents\030\n \001(\tH\000\032-\n\013La" + + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\"*\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACT" + + "IVE\020\001:d\352Aa\n!workflows.googleapis.com/Wor" + + "kflow\022\202\323\344\223\002/\022-/v1/{parent=projec" + + "ts/*/locations/*}/workflows\332A\006parent\022\237\001\n" + + "\013GetWorkflow\022-.google.cloud.workflows.v1" + + ".GetWorkflowRequest\032#.google.cloud.workf" + + "lows.v1.Workflow\"<\202\323\344\223\002/\022-/v1/{name=proj" + + "ects/*/locations/*/workflows/*}\332A\004name\022\340" + + "\001\n\016CreateWorkflow\0220.google.cloud.workflo" + + "ws.v1.CreateWorkflowRequest\032\035.google.lon" + + "grunning.Operation\"}\202\323\344\223\0029\"-/v1/{parent=" + + "projects/*/locations/*}/workflows:\010workf" + + "low\332A\033parent,workflow,workflow_id\312A\035\n\010Wo" + + "rkflow\022\021OperationMetadata\022\314\001\n\016DeleteWork" + + "flow\0220.google.cloud.workflows.v1.DeleteW" + + "orkflowRequest\032\035.google.longrunning.Oper" + + "ation\"i\202\323\344\223\002/*-/v1/{name=projects/*/loca" + + "tions/*/workflows/*}\332A\004name\312A*\n\025google.p" + + "rotobuf.Empty\022\021OperationMetadata\022\342\001\n\016Upd" + + "ateWorkflow\0220.google.cloud.workflows.v1." + + "UpdateWorkflowRequest\032\035.google.longrunni" + + "ng.Operation\"\177\202\323\344\223\002B26/v1/{workflow.name" + + "=projects/*/locations/*/workflows/*}:\010wo" + + "rkflow\332A\024workflow,update_mask\312A\035\n\010Workfl" + + "ow\022\021OperationMetadata\032L\312A\030workflows.goog" + + "leapis.com\322A.https://www.googleapis.com/" + + "auth/cloud-platformBu\n\035com.google.cloud." + + "workflows.v1B\016WorkflowsProtoP\001ZBgoogle.g" + + "olang.org/genproto/googleapis/cloud/work" + + "flows/v1;workflowsb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_workflows_v1_Workflow_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_workflows_v1_Workflow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_Workflow_descriptor, + new java.lang.String[] { + "Name", + "Description", + "State", + "RevisionId", + "CreateTime", + "UpdateTime", + "RevisionCreateTime", + "Labels", + "ServiceAccount", + "SourceContents", + "SourceCode", + }); + internal_static_google_cloud_workflows_v1_Workflow_LabelsEntry_descriptor = + internal_static_google_cloud_workflows_v1_Workflow_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_workflows_v1_Workflow_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_Workflow_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_ListWorkflowsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_ListWorkflowsResponse_descriptor, + new java.lang.String[] { + "Workflows", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workflows_v1_GetWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_workflows_v1_GetWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_GetWorkflowRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_CreateWorkflowRequest_descriptor, + new java.lang.String[] { + "Parent", "Workflow", "WorkflowId", + }); + internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_DeleteWorkflowRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_UpdateWorkflowRequest_descriptor, + new java.lang.String[] { + "Workflow", "UpdateMask", + }); + internal_static_google_cloud_workflows_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_workflows_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", "EndTime", "Target", "Verb", "ApiVersion", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-workflows/proto-google-cloud-workflows-v1/src/main/proto/google/cloud/workflows/v1/workflows.proto b/java-workflows/proto-google-cloud-workflows-v1/src/main/proto/google/cloud/workflows/v1/workflows.proto new file mode 100644 index 000000000000..7e46c2f69776 --- /dev/null +++ b/java-workflows/proto-google-cloud-workflows-v1/src/main/proto/google/cloud/workflows/v1/workflows.proto @@ -0,0 +1,314 @@ +// 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.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/v1;workflows"; +option java_multiple_files = true; +option java_outer_classname = "WorkflowsProto"; +option java_package = "com.google.cloud.workflows.v1"; + +// Workflows is used to deploy and execute workflow programs. +// Workflows makes sure the program executes reliably, despite hardware and +// networking interruptions. +service Workflows { + option (google.api.default_host) = "workflows.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Workflows in a given project and location. + // The default order is not specified. + rpc ListWorkflows(ListWorkflowsRequest) returns (ListWorkflowsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/workflows" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Workflow. + rpc GetWorkflow(GetWorkflowRequest) returns (Workflow) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workflows/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new workflow. If a workflow with the specified name already + // exists in the specified project and location, the long running operation + // will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + rpc CreateWorkflow(CreateWorkflowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/workflows" + body: "workflow" + }; + option (google.api.method_signature) = "parent,workflow,workflow_id"; + option (google.longrunning.operation_info) = { + response_type: "Workflow" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a workflow with the specified name. + // This method also cancels and deletes all running executions of the + // workflow. + rpc DeleteWorkflow(DeleteWorkflowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workflows/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workflow. + // Running this method has no impact on already running executions of the + // workflow. A new revision of the workflow may be created as a result of a + // successful update operation. In that case, such revision will be used + // in new workflow executions. + rpc UpdateWorkflow(UpdateWorkflowRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{workflow.name=projects/*/locations/*/workflows/*}" + body: "workflow" + }; + option (google.api.method_signature) = "workflow,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Workflow" + metadata_type: "OperationMetadata" + }; + } +} + +// Workflow program to be executed by Workflows. +message Workflow { + option (google.api.resource) = { + type: "workflows.googleapis.com/Workflow" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}" + }; + + // Describes the current state of workflow deployment. More states may be + // added in the future. + enum State { + // Invalid state. + STATE_UNSPECIFIED = 0; + + // The workflow has been deployed successfully and is serving. + ACTIVE = 1; + } + + // The resource name of the workflow. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + string name = 1; + + // Description of the workflow provided by the user. + // Must be at most 1000 unicode characters long. + string description = 2; + + // Output only. State of the workflow deployment. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The revision of the workflow. + // A new revision of a workflow is created as a result of updating the + // following fields of a workflow: + // - `source_code` + // - `service_account` + // The format is "000001-a4d", where the first 6 characters define + // the zero-padded revision ordinal number. They are followed by a hyphen and + // 3 hexadecimal random characters. + string revision_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of when the workflow was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the workflow. + google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the latest revision of the workflow + // was created. + google.protobuf.Timestamp revision_create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this workflow. + // Labels can contain at most 64 entries. Keys and values can be no longer + // than 63 characters and can only contain lowercase letters, numeric + // characters, underscores and dashes. Label keys must start with a letter. + // International characters are allowed. + map labels = 8; + + // Name of the service account associated with the latest workflow version. + // This service account represents the identity of the workflow and determines + // what permissions the workflow has. + // Format: projects/{project}/serviceAccounts/{account} + // + // Using `-` as a wildcard for the `{project}` will infer the project from + // the account. The `{account}` value can be the `email` address or the + // `unique_id` of the service account. + // + // If not provided, workflow will use the project's default service account. + // Modifying this field for an existing workflow results in a new workflow + // revision. + string service_account = 9; + + // Required. Location of the workflow source code. + // Modifying this field for an existing workflow results in a new workflow + // revision. + oneof source_code { + // Workflow code to be executed. The size limit is 32KB. + string source_contents = 10; + } +} + +// Request for the +// [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows] +// method. +message ListWorkflowsRequest { + // Required. Project and location from which the workflows should be listed. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of workflows to return per call. The service may return + // fewer than this value. If the value is not specified, a default value of + // 500 will be used. The maximum permitted value is 1000 and values greater + // than 1000 will be coerced down to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListWorkflows` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListWorkflows` must + // match the call that provided the page token. + string page_token = 3; + + // Filter to restrict results to specific workflows. + string filter = 4; + + // Comma-separated list of fields that that specify the order of the results. + // Default sorting order for a field is ascending. To specify descending order + // for a field, append a " desc" suffix. + // If not specified, the results will be returned in an unspecified order. + string order_by = 5; +} + +// Response for the +// [ListWorkflows][google.cloud.workflows.v1.Workflows.ListWorkflows] +// method. +message ListWorkflowsResponse { + // The workflows which match the request. + repeated Workflow workflows = 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; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Request for the +// [GetWorkflow][google.cloud.workflows.v1.Workflows.GetWorkflow] method. +message GetWorkflowRequest { + // Required. Name of the workflow which information should be retrieved. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; +} + +// Request for the +// [CreateWorkflow][google.cloud.workflows.v1.Workflows.CreateWorkflow] +// method. +message CreateWorkflowRequest { + // Required. Project and location in which the workflow should be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Workflow to be created. + Workflow workflow = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the workflow to be created. It has to fulfill the + // following requirements: + // + // * Must contain only letters, numbers, underscores and hyphens. + // * Must start with a letter. + // * Must be between 1-64 characters. + // * Must end with a number or a letter. + // * Must be unique within the customer project and location. + string workflow_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the +// [DeleteWorkflow][google.cloud.workflows.v1.Workflows.DeleteWorkflow] +// method. +message DeleteWorkflowRequest { + // Required. Name of the workflow to be deleted. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; +} + +// Request for the +// [UpdateWorkflow][google.cloud.workflows.v1.Workflows.UpdateWorkflow] +// method. +message UpdateWorkflowRequest { + // Required. Workflow to be updated. + Workflow workflow = 1 [(google.api.field_behavior) = REQUIRED]; + + // List of fields to be updated. If not present, the entire workflow + // will be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // API version used to start the operation. + string api_version = 5; +} diff --git a/java-workflows/synth.py b/java-workflows/synth.py deleted file mode 100644 index 6e14a120832e..000000000000 --- a/java-workflows/synth.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.java as java - -service = 'workflows' -versions = ['v1beta'] - -for version in versions: - java.bazel_library( - service=service, - version=version, - proto_path=f'google/cloud/workflows/{version}', - bazel_target=f'//google/cloud/workflows/{version}:google-cloud-{service}-{version}-java', - ) - -java.common_templates() \ No newline at end of file diff --git a/java-workflows/versions.txt b/java-workflows/versions.txt index 83e896e431a5..8a7c66c21c2f 100644 --- a/java-workflows/versions.txt +++ b/java-workflows/versions.txt @@ -2,5 +2,7 @@ # module:released-version:current-version google-cloud-workflows:0.3.1:0.3.2-SNAPSHOT +grpc-google-cloud-workflows-v1beta:0.3.1:0.3.2-SNAPSHOT +grpc-google-cloud-workflows-v1:0.3.1:0.3.2-SNAPSHOT proto-google-cloud-workflows-v1beta:0.3.1:0.3.2-SNAPSHOT -grpc-google-cloud-workflows-v1beta:0.3.1:0.3.2-SNAPSHOT \ No newline at end of file +proto-google-cloud-workflows-v1:0.3.1:0.3.2-SNAPSHOT