From 42ce0b46e60a653032e45642a6e96c5cbcd0b269 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 14 Sep 2020 10:55:09 -0700 Subject: [PATCH] feat: initial client generation --- .github/CODEOWNERS | 8 + .github/ISSUE_TEMPLATE/bug_report.md | 51 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/support_request.md | 7 + .github/PULL_REQUEST_TEMPLATE.md | 7 + .github/release-please.yml | 2 + .github/trusted-contribution.yml | 2 + .github/workflows/ci.yaml | 79 + .github/workflows/samples.yaml | 14 + .gitignore | 17 + .kokoro/build.bat | 3 + .kokoro/build.sh | 111 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 59 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/java8.cfg | 12 + .kokoro/dependencies.sh | 89 + .kokoro/linkage-monitor.sh | 46 + .kokoro/nightly/common.cfg | 25 + .kokoro/nightly/integration.cfg | 37 + .kokoro/nightly/java11.cfg | 7 + .kokoro/nightly/java7.cfg | 7 + .kokoro/nightly/java8-osx.cfg | 3 + .kokoro/nightly/java8-win.cfg | 3 + .kokoro/nightly/java8.cfg | 12 + .kokoro/nightly/samples.cfg | 38 + .kokoro/populate-secrets.sh | 43 + .kokoro/presubmit/clirr.cfg | 13 + .kokoro/presubmit/common.cfg | 34 + .kokoro/presubmit/dependencies.cfg | 12 + .kokoro/presubmit/integration.cfg | 33 + .kokoro/presubmit/java11.cfg | 7 + .kokoro/presubmit/java7.cfg | 7 + .kokoro/presubmit/java8-osx.cfg | 3 + .kokoro/presubmit/java8-win.cfg | 3 + .kokoro/presubmit/java8.cfg | 12 + .kokoro/presubmit/linkage-monitor.cfg | 12 + .kokoro/presubmit/lint.cfg | 13 + .kokoro/presubmit/samples.cfg | 33 + .kokoro/release/bump_snapshot.cfg | 53 + .kokoro/release/common.cfg | 49 + .kokoro/release/common.sh | 50 + .kokoro/release/drop.cfg | 6 + .kokoro/release/drop.sh | 32 + .kokoro/release/promote.cfg | 6 + .kokoro/release/promote.sh | 34 + .kokoro/release/publish_javadoc.cfg | 29 + .kokoro/release/publish_javadoc.sh | 76 + .kokoro/release/snapshot.cfg | 6 + .kokoro/release/snapshot.sh | 33 + .kokoro/release/stage.cfg | 19 + .kokoro/release/stage.sh | 42 + .kokoro/trampoline.sh | 26 + .repo-metadata.json | 15 + CODE_OF_CONDUCT.md | 93 + CONTRIBUTING.md | 139 + LICENSE | 202 ++ README.md | 144 + codecov.yaml | 4 + google-cloud-workflows-bom/pom.xml | 97 + google-cloud-workflows/pom.xml | 111 + .../workflows/v1beta/WorkflowsClient.java | 910 +++++ .../workflows/v1beta/WorkflowsSettings.java | 275 ++ .../cloud/workflows/v1beta/package-info.java | 41 + .../stub/GrpcWorkflowsCallableFactory.java | 115 + .../v1beta/stub/GrpcWorkflowsStub.java | 342 ++ .../workflows/v1beta/stub/WorkflowsStub.java | 97 + .../v1beta/stub/WorkflowsStubSettings.java | 585 +++ .../cloud/workflows/v1beta/MockWorkflows.java | 57 + .../workflows/v1beta/MockWorkflowsImpl.java | 133 + .../workflows/v1beta/WorkflowsClientTest.java | 354 ++ grpc-google-cloud-workflows-v1beta/pom.xml | 69 + .../cloud/workflows/v1beta/WorkflowsGrpc.java | 851 +++++ java.header | 15 + license-checks.xml | 10 + pom.xml | 189 + proto-google-cloud-workflows-v1beta/pom.xml | 42 + .../v1beta/CreateWorkflowRequest.java | 1184 +++++++ .../CreateWorkflowRequestOrBuilder.java | 134 + .../v1beta/DeleteWorkflowRequest.java | 662 ++++ .../DeleteWorkflowRequestOrBuilder.java | 56 + .../workflows/v1beta/GetWorkflowRequest.java | 659 ++++ .../v1beta/GetWorkflowRequestOrBuilder.java | 56 + .../v1beta/ListWorkflowsRequest.java | 1343 +++++++ .../v1beta/ListWorkflowsRequestOrBuilder.java | 159 + .../v1beta/ListWorkflowsResponse.java | 1418 ++++++++ .../ListWorkflowsResponseOrBuilder.java | 155 + .../cloud/workflows/v1beta/LocationName.java | 182 + .../workflows/v1beta/OperationMetadata.java | 1534 ++++++++ .../v1beta/OperationMetadataOrBuilder.java | 170 + .../v1beta/UpdateWorkflowRequest.java | 1046 ++++++ .../UpdateWorkflowRequestOrBuilder.java | 104 + .../cloud/workflows/v1beta/Workflow.java | 3146 +++++++++++++++++ .../cloud/workflows/v1beta/WorkflowName.java | 211 ++ .../workflows/v1beta/WorkflowOrBuilder.java | 411 +++ .../workflows/v1beta/WorkflowsProto.java | 271 ++ .../cloud/workflows/v1beta/workflows.proto | 314 ++ renovate.json | 81 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 47 + synth.metadata | 133 + synth.py | 32 + versions.txt | 6 + 106 files changed, 20049 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/support_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/release-please.yml create mode 100644 .github/trusted-contribution.yml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/samples.yaml create mode 100644 .gitignore create mode 100644 .kokoro/build.bat create mode 100755 .kokoro/build.sh create mode 100755 .kokoro/coerce_logs.sh create mode 100644 .kokoro/common.cfg create mode 100644 .kokoro/common.sh create mode 100644 .kokoro/continuous/common.cfg create mode 100644 .kokoro/continuous/java8.cfg create mode 100755 .kokoro/dependencies.sh create mode 100755 .kokoro/linkage-monitor.sh create mode 100644 .kokoro/nightly/common.cfg create mode 100644 .kokoro/nightly/integration.cfg create mode 100644 .kokoro/nightly/java11.cfg create mode 100644 .kokoro/nightly/java7.cfg create mode 100644 .kokoro/nightly/java8-osx.cfg create mode 100644 .kokoro/nightly/java8-win.cfg create mode 100644 .kokoro/nightly/java8.cfg create mode 100644 .kokoro/nightly/samples.cfg create mode 100755 .kokoro/populate-secrets.sh create mode 100644 .kokoro/presubmit/clirr.cfg create mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/dependencies.cfg create mode 100644 .kokoro/presubmit/integration.cfg create mode 100644 .kokoro/presubmit/java11.cfg create mode 100644 .kokoro/presubmit/java7.cfg create mode 100644 .kokoro/presubmit/java8-osx.cfg create mode 100644 .kokoro/presubmit/java8-win.cfg create mode 100644 .kokoro/presubmit/java8.cfg create mode 100644 .kokoro/presubmit/linkage-monitor.cfg create mode 100644 .kokoro/presubmit/lint.cfg create mode 100644 .kokoro/presubmit/samples.cfg create mode 100644 .kokoro/release/bump_snapshot.cfg create mode 100644 .kokoro/release/common.cfg create mode 100755 .kokoro/release/common.sh create mode 100644 .kokoro/release/drop.cfg create mode 100755 .kokoro/release/drop.sh create mode 100644 .kokoro/release/promote.cfg create mode 100755 .kokoro/release/promote.sh create mode 100644 .kokoro/release/publish_javadoc.cfg create mode 100755 .kokoro/release/publish_javadoc.sh create mode 100644 .kokoro/release/snapshot.cfg create mode 100755 .kokoro/release/snapshot.sh create mode 100644 .kokoro/release/stage.cfg create mode 100755 .kokoro/release/stage.sh create mode 100644 .kokoro/trampoline.sh create mode 100644 .repo-metadata.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 codecov.yaml create mode 100644 google-cloud-workflows-bom/pom.xml create mode 100644 google-cloud-workflows/pom.xml create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java create mode 100644 google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java create mode 100644 google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java create mode 100644 google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java create mode 100644 google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java create mode 100644 grpc-google-cloud-workflows-v1beta/pom.xml create mode 100644 grpc-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 pom.xml create mode 100644 proto-google-cloud-workflows-v1beta/pom.xml create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequest.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequestOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequest.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequestOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequest.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequestOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequest.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequestOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponse.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponseOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadata.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequest.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequestOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/Workflow.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowOrBuilder.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsProto.java create mode 100644 proto-google-cloud-workflows-v1beta/src/main/proto/google/cloud/workflows/v1beta/workflows.proto create mode 100644 renovate.json create mode 100644 samples/install-without-bom/pom.xml create mode 100644 samples/pom.xml create mode 100644 samples/snapshot/pom.xml create mode 100644 samples/snippets/pom.xml create mode 100644 synth.metadata create mode 100644 synth.py create mode 100644 versions.txt diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..6137bef2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,8 @@ +# Code owners file. +# This file controls who is tagged for review for any given pull request. + +# For syntax help see: +# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax + +# The java-samples-reviewers team is the default owner for samples changes +samples/**/*.java @googleapis/java-samples-reviewers diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..2f52f6a1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +Please run down the following list and make sure you've tried the usual "quick fixes": + + - Search the issues already opened: https://github.com/googleapis/java-workflows/issues + - Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform + +If you are still having issues, please include as much information as possible: + +#### Environment details + +1. Specify the API at the beginning of the title. For example, "BigQuery: ..."). + General, Core, and Other are also allowed as types +2. OS type and version: +3. Java version: +4. workflows version(s): + +#### Steps to reproduce + + 1. ? + 2. ? + +#### Code example + +```java +// example +``` + +#### Stack trace +``` +Any relevant stacktrace here. +``` + +#### External references such as API reference guides + +- ? + +#### Any additional information below + + +Following these steps guarantees the quickest resolution possible. + +Thanks! diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..754e30c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this library + +--- + +Thanks for stopping by to let us know something could be better! + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. + +**Is your feature request related to a problem? Please describe.** +What the problem is. Example: I'm always frustrated when [...] + +**Describe the solution you'd like** +What you want to happen. + +**Describe alternatives you've considered** +Any alternative solutions or features you've considered. + +**Additional context** +Any other context or screenshots about the feature request. diff --git a/.github/ISSUE_TEMPLATE/support_request.md b/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 00000000..99586903 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/support_request.md @@ -0,0 +1,7 @@ +--- +name: Support request +about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. + +--- + +**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..495c726e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-workflows/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..dce2c845 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,2 @@ +releaseType: java-yoshi +bumpMinorPreMajor: true \ No newline at end of file diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml new file mode 100644 index 00000000..f247d5c7 --- /dev/null +++ b/.github/trusted-contribution.yml @@ -0,0 +1,2 @@ +trustedContributors: +- renovate-bot \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..68302207 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,79 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + matrix: + java: [7, 8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + - name: coverage + uses: codecov/codecov-action@v1 + with: + name: actions ${{matrix.java}} + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [8, 11] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + linkage-monitor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/linkage-monitor.sh + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr \ No newline at end of file diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..a1d50073 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..cc0bc34a --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml \ No newline at end of file diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 00000000..05826ad9 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh new file mode 100755 index 00000000..20a42a23 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,111 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C + +# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then + export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) +fi + +RETURN_CODE=0 +set +e + +case ${JOB_TYPE} in +test) + mvn test -B -Dclirr.skip=true -Denforcer.skip=true + RETURN_CODE=$? + ;; +lint) + mvn com.coveo:fmt-maven-plugin:check + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +samples) + if [[ -f samples/pom.xml ]] + then + pushd samples + mvn -B \ + -Penable-samples \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_BUILD_COP}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop + ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-workflows +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh new file mode 100755 index 00000000..5cf7ba49 --- /dev/null +++ b/.kokoro/coerce_logs.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Copyright 2019 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 finds and moves sponge logs so that they can be found by placer +# and are not flagged as flaky by sponge. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +job=$(basename ${KOKORO_JOB_NAME}) + +echo "coercing sponge logs..." +for xml in `find . -name *-sponge_log.xml` +do + echo "processing ${xml}" + class=$(basename ${xml} | cut -d- -f2) + dir=$(dirname ${xml})/${job}/${class} + text=$(dirname ${xml})/${class}-sponge_log.txt + mkdir -p ${dir} + mv ${xml} ${dir}/sponge_log.xml + mv ${text} ${dir}/sponge_log.txt +done diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg new file mode 100644 index 00000000..4ec98769 --- /dev/null +++ b/.kokoro/common.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# All builds use the trampoline script to run in docker. +build_file: "java-workflows/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/build.sh" +} diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 00000000..a8d0ea04 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# 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. + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + + # store current flag state + flags=$- + + # allow a failures to continue + set +e + echo "${command}" + ${command} + exit_code=$? + + # restore "e" flag + if [[ ${flags} =~ e ]] + then set -e + else set +e + fi + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} + +## Helper functionss +function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } +function msg() { println "$*" >&2; } +function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file diff --git a/.kokoro/continuous/common.cfg b/.kokoro/continuous/common.cfg new file mode 100644 index 00000000..5270a080 --- /dev/null +++ b/.kokoro/continuous/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-workflows/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/continuous/java8.cfg b/.kokoro/continuous/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/continuous/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh new file mode 100755 index 00000000..c91e5a56 --- /dev/null +++ b/.kokoro/dependencies.sh @@ -0,0 +1,89 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true + +echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" +## Run dependency list completeness check +function completenessCheck() { + # Output dep list with compile scope generated using the original pom + # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. + # This is stripped from the output as it is not present in the flattened pom. + # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. + msg "Generating dependency list using original pom..." + mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt + + # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) + msg "Generating dependency list using flattened pom..." + mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt + + # Compare two dependency lists + msg "Comparing dependency lists..." + diff .org-list.txt .new-list.txt >.diff.txt + if [[ $? == 0 ]] + then + msg "Success. No diff!" + else + msg "Diff found. See below: " + msg "You can also check .diff.txt file located in $1." + cat .diff.txt + return 1 + fi +} + +# Allow failures to continue running the script +set +e + +error_count=0 +for path in $(find -name ".flattened-pom.xml") +do + # Check flattened pom in each dir that contains it for completeness + dir=$(dirname "$path") + pushd "$dir" + completenessCheck "$dir" + error_count=$(($error_count + $?)) + popd +done + +if [[ $error_count == 0 ]] +then + msg "All checks passed." + exit 0 +else + msg "Errors found. See log statements above." + exit 1 +fi \ No newline at end of file diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh new file mode 100755 index 00000000..759ab4e2 --- /dev/null +++ b/.kokoro/linkage-monitor.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail +# Display commands being run. +set -x + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java version +java -version +echo ${JOB_TYPE} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true + +# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR +JAR=linkage-monitor-latest-all-deps.jar +curl -v -O "https://storage.googleapis.com/cloud-opensource-java-linkage-monitor/${JAR}" + +# Fails if there's new linkage errors compared with baseline +java -jar ${JAR} com.google.cloud:libraries-bom diff --git a/.kokoro/nightly/common.cfg b/.kokoro/nightly/common.cfg new file mode 100644 index 00000000..5270a080 --- /dev/null +++ b/.kokoro/nightly/common.cfg @@ -0,0 +1,25 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-workflows/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg new file mode 100644 index 00000000..0048c8ec --- /dev/null +++ b/.kokoro/nightly/integration.cfg @@ -0,0 +1,37 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/nightly/java11.cfg b/.kokoro/nightly/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/nightly/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/nightly/java7.cfg b/.kokoro/nightly/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/nightly/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/nightly/java8-osx.cfg b/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 00000000..728da7d6 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflows/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..94b8066e --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflows/.kokoro/build.bat" diff --git a/.kokoro/nightly/java8.cfg b/.kokoro/nightly/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/nightly/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/nightly/samples.cfg b/.kokoro/nightly/samples.cfg new file mode 100644 index 00000000..f2542931 --- /dev/null +++ b/.kokoro/nightly/samples.cfg @@ -0,0 +1,38 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} + +env_vars: { + key: "ENABLE_BUILD_COP" + value: "true" +} diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh new file mode 100755 index 00000000..f5251425 --- /dev/null +++ b/.kokoro/populate-secrets.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# 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. + +set -eo pipefail + +function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;} +function msg { println "$*" >&2 ;} +function println { printf '%s\n' "$(now) $*" ;} + + +# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: +# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" +msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" +mkdir -p ${SECRET_LOCATION} +for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g") +do + msg "Retrieving secret ${key}" + docker run --entrypoint=gcloud \ + --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ + gcr.io/google.com/cloudsdktool/cloud-sdk \ + secrets versions access latest \ + --project cloud-devrel-kokoro-resources \ + --secret ${key} > \ + "${SECRET_LOCATION}/${key}" + if [[ $? == 0 ]]; then + msg "Secret written to ${SECRET_LOCATION}/${key}" + else + msg "Error retrieving secret ${key}" + fi +done diff --git a/.kokoro/presubmit/clirr.cfg b/.kokoro/presubmit/clirr.cfg new file mode 100644 index 00000000..ec572442 --- /dev/null +++ b/.kokoro/presubmit/clirr.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "clirr" +} \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg new file mode 100644 index 00000000..62bb6c1c --- /dev/null +++ b/.kokoro/presubmit/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.txt" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-workflows/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} diff --git a/.kokoro/presubmit/dependencies.cfg b/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 00000000..0f6d5eea --- /dev/null +++ b/.kokoro/presubmit/dependencies.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/dependencies.sh" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg new file mode 100644 index 00000000..dded67a9 --- /dev/null +++ b/.kokoro/presubmit/integration.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} diff --git a/.kokoro/presubmit/java11.cfg b/.kokoro/presubmit/java11.cfg new file mode 100644 index 00000000..709f2b4c --- /dev/null +++ b/.kokoro/presubmit/java11.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} diff --git a/.kokoro/presubmit/java7.cfg b/.kokoro/presubmit/java7.cfg new file mode 100644 index 00000000..cb24f44e --- /dev/null +++ b/.kokoro/presubmit/java7.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java7" +} diff --git a/.kokoro/presubmit/java8-osx.cfg b/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 00000000..728da7d6 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflows/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..94b8066e --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflows/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8.cfg b/.kokoro/presubmit/java8.cfg new file mode 100644 index 00000000..495cc7ba --- /dev/null +++ b/.kokoro/presubmit/java8.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "REPORT_COVERAGE" + value: "true" +} diff --git a/.kokoro/presubmit/linkage-monitor.cfg b/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 00000000..76d47c8d --- /dev/null +++ b/.kokoro/presubmit/linkage-monitor.cfg @@ -0,0 +1,12 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/.kokoro/presubmit/lint.cfg b/.kokoro/presubmit/lint.cfg new file mode 100644 index 00000000..6d323c8a --- /dev/null +++ b/.kokoro/presubmit/lint.cfg @@ -0,0 +1,13 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "lint" +} \ No newline at end of file diff --git a/.kokoro/presubmit/samples.cfg b/.kokoro/presubmit/samples.cfg new file mode 100644 index 00000000..01e09600 --- /dev/null +++ b/.kokoro/presubmit/samples.cfg @@ -0,0 +1,33 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +env_vars: { + key: "JOB_TYPE" + value: "samples" +} + +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "java-docs-samples-testing" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-docs-samples-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-docs-samples-service-account" +} \ No newline at end of file diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg new file mode 100644 index 00000000..9b257127 --- /dev/null +++ b/.kokoro/release/bump_snapshot.cfg @@ -0,0 +1,53 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-workflows/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/bump_snapshot.sh" +} + +# tokens used by release-please to keep an up-to-date release PR. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-key-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-token-release-please" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "github-magic-proxy-url-release-please" + } + } +} diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 00000000..f035a932 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,49 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-workflows/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100755 index 00000000..6e3f6599 --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 00000000..1dd83ab1 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 00000000..5c4551ef --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop -B \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 00000000..00042f4e --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 00000000..1fa95fa5 --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# STAGING_REPOSITORY_ID must be set +if [ -z "${STAGING_REPOSITORY_ID}" ]; then + echo "Missing STAGING_REPOSITORY_ID environment variable" + exit 1 +fi + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml \ + -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg new file mode 100644 index 00000000..9eb0c3f9 --- /dev/null +++ b/.kokoro/release/publish_javadoc.cfg @@ -0,0 +1,29 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" + +env_vars: { + key: "STAGING_BUCKET" + value: "docs-staging" +} + +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2-staging" + # Production will be at: docs-staging-v2 +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/publish_javadoc.sh" +} + + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh new file mode 100755 index 00000000..4d6b43a1 --- /dev/null +++ b/.kokoro/release/publish_javadoc.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# Copyright 2019 Google Inc. +# +# 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. + +set -eo pipefail + +if [[ -z "${CREDENTIALS}" ]]; then + CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account +fi + +if [[ -z "${STAGING_BUCKET}" ]]; then + echo "Need to set STAGING_BUCKET environment variable" + exit 1 +fi + +if [[ -z "${STAGING_BUCKET_V2}" ]]; then + echo "Need to set STAGING_BUCKET_V2 environment variable" + exit 1 +fi + +# work from the git root directory +pushd $(dirname "$0")/../../ + +# install docuploader package +python3 -m pip install gcp-docuploader + +# compile all packages +mvn clean install -B -q -DskipTests=true + +NAME=google-cloud-workflows +VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# build the docs +mvn site -B -q + +pushd target/site/apidocs + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET} + +popd + +# V2 +mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" + +pushd target/devsite + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload docs +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg new file mode 100644 index 00000000..63a499c2 --- /dev/null +++ b/.kokoro/release/snapshot.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/snapshot.sh" +} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh new file mode 100755 index 00000000..098168a7 --- /dev/null +++ b/.kokoro/release/snapshot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright 2019 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. + +set -eo pipefail + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +# ensure we're trying to push a snapshot (no-result returns non-zero exit code) +grep SNAPSHOT versions.txt + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 00000000..d8e3267c --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,19 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-workflows/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-workflows" + } +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 00000000..3c482cbc --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + +source $(dirname "$0")/common.sh +MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy -B \ + --settings ${MAVEN_SETTINGS_FILE} \ + -DskipTests=true \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + +if [[ -n "${AUTORELEASE_PR}" ]] +then + mvn nexus-staging:release -B \ + -DperformRelease=true \ + --settings=settings.xml +fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh new file mode 100644 index 00000000..9da0f839 --- /dev/null +++ b/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/.repo-metadata.json b/.repo-metadata.json new file mode 100644 index 00000000..32852881 --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "workflows", + "name_pretty": "Cloud Workflows", + "product_documentation": "https://cloud.google.com/workflows", + "api_description": "allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows.", + "client_documentation": "https://googleapis.dev/java/google-cloud-workflows/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-workflows", + "repo_short": "java-workflows", + "distribution_name": "com.google.cloud:google-cloud-workflows", + "api_id": "workflows.googleapis.com", + "requires_billing": true +} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..6b2238bb --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,93 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the +Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..f2dbdee0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# How to Contribute + +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. + +## Contributor License Agreement + +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. + +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. + +## Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Community Guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). + +## Building the project + +To build, package, and run all unit tests run the command + +``` +mvn clean verify +``` + +### Running Integration tests + +To include integration tests when building the project, you need access to +a GCP Project with a valid service account. + +For instructions on how to generate a service account and corresponding +credentials JSON see: [Creating a Service Account][1]. + +Then run the following to build, package, run all unit tests and run all +integration tests. + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-integration-tests clean verify +``` + +## Code Samples + +Code Samples must be bundled in separate Maven modules, and guarded by a +Maven profile with the name `enable-samples`. + +The samples must be separate from the primary project for a few reasons: +1. Primary projects have a minimum Java version of Java 7 whereas samples have + a minimum Java version of Java 8. Due to this we need the ability to + selectively exclude samples from a build run. +2. Many code samples depend on external GCP services and need + credentials to access the service. +3. Code samples are not released as Maven artifacts and must be excluded from + release builds. + +### Building + +```bash +mvn -Penable-samples clean verify +``` + +Some samples require access to GCP services and require a service account: + +```bash +export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json +mvn -Penable-samples clean verify +``` + +### Profile Config + +1. To add samples in a profile to your Maven project, add the following to your +`pom.xml` + + ```xml + + [...] + + + enable-samples + + sample + + + + [...] + + ``` + +2. [Activate](#profile-activation) the profile. +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` + +### Profile Activation + +To include code samples when building and testing the project, enable the +`enable-samples` Maven profile. + +#### Command line + +To activate the Maven profile on the command line add `-Penable-samples` to your +Maven command. + +#### Maven `settings.xml` + +To activate the Maven profile in your `~/.m2/settings.xml` add an entry of +`enable-samples` following the instructions in [Active Profiles][2]. + +This method has the benefit of applying to all projects you build (and is +respected by IntelliJ IDEA) and is recommended if you are going to be +contributing samples to several projects. + +#### IntelliJ IDEA + +To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in +[Activate Maven profiles][3] to activate `enable-samples`. + +[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account +[2]: https://maven.apache.org/settings.html#Active_Profiles +[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/README.md b/README.md new file mode 100644 index 00000000..fa0219b3 --- /dev/null +++ b/README.md @@ -0,0 +1,144 @@ +# Google Cloud Workflows Client for Java + +Java idiomatic client for [Cloud Workflows][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +## Quickstart + + +If you are using Maven, add this to your pom.xml file: + +```xml + + com.google.cloud + google-cloud-workflows + 0.0.0 + + +``` + +[//]: # ({x-version-update-start:google-cloud-workflows:released}) + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-workflows:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-workflows" % "0.0.0" +``` +[//]: # ({x-version-update-end}) + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Workflows [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Workflows. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-workflows` library. See the [Quickstart](#quickstart) section +to add `google-cloud-workflows` as a dependency in your code. + +## About Cloud Workflows + + +[Cloud Workflows][product-docs] allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows. + +See the [Cloud Workflows client library docs][javadocs] to learn how to +use this Cloud Workflows Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Workflows uses gRPC for the transport layer. + +## Java Versions + +Java 7 or above is required for using this client. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time +and the public API should not be considered stable. + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +[product-docs]: https://cloud.google.com/workflows +[javadocs]: https://googleapis.dev/java/google-cloud-workflows/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java11.html +[stability-image]: https://img.shields.io/badge/stability-beta-yellow +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-workflows.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-workflows&core=gav +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-sdk]: https://cloud.google.com/sdk/ +[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting +[contributing]: https://github.com/googleapis/java-workflows/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-workflows/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-workflows/blob/master/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=workflows.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..5724ea94 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/google-cloud-workflows-bom/pom.xml b/google-cloud-workflows-bom/pom.xml new file mode 100644 index 00000000..b1147e3b --- /dev/null +++ b/google-cloud-workflows-bom/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflows-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + Google Cloud Workflows BOM + https://github.com/googleapis/java-workflows + + BOM for Cloud Workflows + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-workflows.git + scm:git:git@github.com:googleapis/java-workflows.git + https://github.com/googleapis/java-workflows + + + + true + + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + + com.google.cloud + google-cloud-workflows + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workflows-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflows-v1beta + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-workflows/pom.xml b/google-cloud-workflows/pom.xml new file mode 100644 index 00000000..c424bca5 --- /dev/null +++ b/google-cloud-workflows/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflows + 0.0.1-SNAPSHOT + jar + Google Cloud Workflows + https://github.com/googleapis/java-workflows + allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows. + + com.google.cloud + google-cloud-workflows-parent + 0.0.1-SNAPSHOT + + + google-cloud-workflows + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-workflows-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + + + junit + junit + test + 4.13 + + + + com.google.api.grpc + grpc-google-cloud-workflows-v1beta + test + + + + com.google.api + gax-grpc + testlib + test + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java new file mode 100644 index 00000000..1198df31 --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java @@ -0,0 +1,910 @@ +/* + * 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.v1beta; + +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.v1beta.stub.WorkflowsStub; +import com.google.cloud.workflows.v1beta.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 SERVICE +/** + * 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: + * + *

+ * 
+ * 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: + * + *

+ * 
+ * WorkflowsSettings workflowsSettings =
+ *     WorkflowsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * WorkflowsClient workflowsClient =
+ *     WorkflowsClient.create(workflowsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * WorkflowsSettings workflowsSettings =
+ *     WorkflowsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * WorkflowsClient workflowsClient =
+ *     WorkflowsClient.create(workflowsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +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 to use 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. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Workflow element : workflowsClient.listWorkflows(parent.toString()).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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListWorkflowsRequest request = ListWorkflowsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListWorkflowsRequest request = ListWorkflowsRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListWorkflowsPagedResponse> 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: + * + *


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

Sample 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   Workflow response = workflowsClient.getWorkflow(name.toString());
+   * }
+   * 
+ * + * @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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   GetWorkflowRequest request = GetWorkflowRequest.newBuilder()
+   *     .setName(name.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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   GetWorkflowRequest request = GetWorkflowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Workflow> 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "";
+   *   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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "";
+   *   Workflow response = workflowsClient.createWorkflowAsync(parent.toString(), 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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "";
+   *   CreateWorkflowRequest request = CreateWorkflowRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWorkflow(workflow)
+   *     .setWorkflowId(workflowId)
+   *     .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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "";
+   *   CreateWorkflowRequest request = CreateWorkflowRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWorkflow(workflow)
+   *     .setWorkflowId(workflowId)
+   *     .build();
+   *   OperationFuture<Workflow, OperationMetadata> future = workflowsClient.createWorkflowOperationCallable().futureCall(request);
+   *   // Do something
+   *   Workflow response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   String workflowId = "";
+   *   CreateWorkflowRequest request = CreateWorkflowRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setWorkflow(workflow)
+   *     .setWorkflowId(workflowId)
+   *     .build();
+   *   ApiFuture<Operation> 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: + * + *


+   * 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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   workflowsClient.deleteWorkflowAsync(name.toString()).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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   DeleteWorkflowRequest request = DeleteWorkflowRequest.newBuilder()
+   *     .setName(name.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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   DeleteWorkflowRequest request = DeleteWorkflowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadata> future = workflowsClient.deleteWorkflowOperationCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   DeleteWorkflowRequest request = DeleteWorkflowRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> 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: + * + *


+   * 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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   UpdateWorkflowRequest request = UpdateWorkflowRequest.newBuilder()
+   *     .setWorkflow(workflow)
+   *     .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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   UpdateWorkflowRequest request = UpdateWorkflowRequest.newBuilder()
+   *     .setWorkflow(workflow)
+   *     .build();
+   *   OperationFuture<Workflow, OperationMetadata> future = workflowsClient.updateWorkflowOperationCallable().futureCall(request);
+   *   // Do something
+   *   Workflow response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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: + * + *


+   * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+   *   Workflow workflow = Workflow.newBuilder().build();
+   *   UpdateWorkflowRequest request = UpdateWorkflowRequest.newBuilder()
+   *     .setWorkflow(workflow)
+   *     .build();
+   *   ApiFuture<Operation> 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/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java new file mode 100644 index 00000000..a160c792 --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java @@ -0,0 +1,275 @@ +/* + * 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.v1beta; + +import static com.google.cloud.workflows.v1beta.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.v1beta.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: + * + *

+ * 
+ * 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") +@BetaApi +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. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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)); + } + + private static Builder createDefault() { + return new Builder(WorkflowsStubSettings.newBuilder()); + } + + protected Builder(WorkflowsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(WorkflowsStubSettings.Builder stubSettings) { + super(stubSettings); + } + + 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. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + 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. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateWorkflowOperationSettings() { + return getStubSettingsBuilder().updateWorkflowOperationSettings(); + } + + @Override + public WorkflowsSettings build() throws IOException { + return new WorkflowsSettings(this); + } + } +} diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java new file mode 100644 index 00000000..f8aedba1 --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * A client to Workflows API. + * + *

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: + * + *

+ * 
+ * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
+ *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Workflow response = workflowsClient.getWorkflow(name);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.workflows.v1beta; + +import javax.annotation.Generated; diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java new file mode 100644 index 00000000..732aaaeb --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.v1beta.stub; + +import com.google.api.core.BetaApi; +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.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Workflows API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java new file mode 100644 index 00000000..fa8d6fc3 --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java @@ -0,0 +1,342 @@ +/* + * 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.v1beta.stub; + +import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; + +import com.google.api.core.BetaApi; +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.v1beta.CreateWorkflowRequest; +import com.google.cloud.workflows.v1beta.DeleteWorkflowRequest; +import com.google.cloud.workflows.v1beta.GetWorkflowRequest; +import com.google.cloud.workflows.v1beta.ListWorkflowsRequest; +import com.google.cloud.workflows.v1beta.ListWorkflowsResponse; +import com.google.cloud.workflows.v1beta.OperationMetadata; +import com.google.cloud.workflows.v1beta.UpdateWorkflowRequest; +import com.google.cloud.workflows.v1beta.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 Workflows API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcWorkflowsStub extends WorkflowsStub { + + private static final MethodDescriptor + listWorkflowsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows/UpdateWorkflow") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateWorkflowRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + 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 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, + this.operationsStub); + this.deleteWorkflowCallable = + callableFactory.createUnaryCallable( + deleteWorkflowTransportSettings, settings.deleteWorkflowSettings(), clientContext); + this.deleteWorkflowOperationCallable = + callableFactory.createOperationCallable( + deleteWorkflowTransportSettings, + settings.deleteWorkflowOperationSettings(), + clientContext, + this.operationsStub); + this.updateWorkflowCallable = + callableFactory.createUnaryCallable( + updateWorkflowTransportSettings, settings.updateWorkflowSettings(), clientContext); + this.updateWorkflowOperationCallable = + callableFactory.createOperationCallable( + updateWorkflowTransportSettings, + settings.updateWorkflowOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listWorkflowsPagedCallable() { + return listWorkflowsPagedCallable; + } + + public UnaryCallable listWorkflowsCallable() { + return listWorkflowsCallable; + } + + public UnaryCallable getWorkflowCallable() { + return getWorkflowCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createWorkflowOperationCallable() { + return createWorkflowOperationCallable; + } + + public UnaryCallable createWorkflowCallable() { + return createWorkflowCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteWorkflowOperationCallable() { + return deleteWorkflowOperationCallable; + } + + public UnaryCallable deleteWorkflowCallable() { + return deleteWorkflowCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateWorkflowOperationCallable() { + return updateWorkflowOperationCallable; + } + + public UnaryCallable updateWorkflowCallable() { + return updateWorkflowCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java new file mode 100644 index 00000000..675445f3 --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java @@ -0,0 +1,97 @@ +/* + * 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.v1beta.stub; + +import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; + +import com.google.api.core.BetaApi; +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.v1beta.CreateWorkflowRequest; +import com.google.cloud.workflows.v1beta.DeleteWorkflowRequest; +import com.google.cloud.workflows.v1beta.GetWorkflowRequest; +import com.google.cloud.workflows.v1beta.ListWorkflowsRequest; +import com.google.cloud.workflows.v1beta.ListWorkflowsResponse; +import com.google.cloud.workflows.v1beta.OperationMetadata; +import com.google.cloud.workflows.v1beta.UpdateWorkflowRequest; +import com.google.cloud.workflows.v1beta.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 Workflows API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class WorkflowsStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createWorkflowOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkflowOperationCallable()"); + } + + public UnaryCallable createWorkflowCallable() { + throw new UnsupportedOperationException("Not implemented: createWorkflowCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteWorkflowOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkflowOperationCallable()"); + } + + public UnaryCallable deleteWorkflowCallable() { + throw new UnsupportedOperationException("Not implemented: deleteWorkflowCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java new file mode 100644 index 00000000..bfa79e98 --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java @@ -0,0 +1,585 @@ +/* + * 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.v1beta.stub; + +import static com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest; +import com.google.cloud.workflows.v1beta.DeleteWorkflowRequest; +import com.google.cloud.workflows.v1beta.GetWorkflowRequest; +import com.google.cloud.workflows.v1beta.ListWorkflowsRequest; +import com.google.cloud.workflows.v1beta.ListWorkflowsResponse; +import com.google.cloud.workflows.v1beta.OperationMetadata; +import com.google.cloud.workflows.v1beta.UpdateWorkflowRequest; +import com.google.cloud.workflows.v1beta.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: + * + *

+ * 
+ * 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") +@BetaApi +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; + + /** 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. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + 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); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + 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(); + } + + 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 + ? payload.getWorkflowsList() + : ImmutableList.of(); + } + }; + + 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); + } + }; + + /** 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( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", 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() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", 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); + } + + 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("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateWorkflowSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createWorkflowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workflow.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteWorkflowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateWorkflowOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Workflow.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + 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); + } + + // 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/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java new file mode 100644 index 00000000..07c903de --- /dev/null +++ b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java @@ -0,0 +1,57 @@ +/* + * 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.v1beta; + +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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +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/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java new file mode 100644 index 00000000..ffd5087f --- /dev/null +++ b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java @@ -0,0 +1,133 @@ +/* + * 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.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.workflows.v1beta.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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +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.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void getWorkflow(GetWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void createWorkflow( + CreateWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void deleteWorkflow( + DeleteWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } + + @Override + public void updateWorkflow( + UpdateWorkflowRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + 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("Unrecognized response type")); + } + } +} diff --git a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java new file mode 100644 index 00000000..6bfa8a8d --- /dev/null +++ b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java @@ -0,0 +1,354 @@ +/* + * 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.v1beta; + +import static com.google.cloud.workflows.v1beta.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 io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class WorkflowsClientTest { + private static MockWorkflows mockWorkflows; + private static MockServiceHelper serviceHelper; + private WorkflowsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockWorkflows = new MockWorkflows(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockWorkflows)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + WorkflowsSettings settings = + WorkflowsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WorkflowsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listWorkflowsTest() { + String nextPageToken = ""; + Workflow workflowsElement = Workflow.newBuilder().build(); + List workflows = Arrays.asList(workflowsElement); + ListWorkflowsResponse expectedResponse = + ListWorkflowsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllWorkflows(workflows) + .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, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listWorkflowsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(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 + @SuppressWarnings("all") + public void getWorkflowTest() { + WorkflowName name2 = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + String description = "description-1724546052"; + String revisionId = "revisionId513861631"; + String serviceAccount = "serviceAccount-1948028253"; + String sourceContents = "sourceContents-1799875906"; + Workflow expectedResponse = + Workflow.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setRevisionId(revisionId) + .setServiceAccount(serviceAccount) + .setSourceContents(sourceContents) + .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, WorkflowName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(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 + @SuppressWarnings("all") + public void createWorkflowTest() throws Exception { + WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + String description = "description-1724546052"; + String revisionId = "revisionId513861631"; + String serviceAccount = "serviceAccount-1948028253"; + String sourceContents = "sourceContents-1799875906"; + Workflow expectedResponse = + Workflow.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setRevisionId(revisionId) + .setServiceAccount(serviceAccount) + .setSourceContents(sourceContents) + .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 = "workflowId1712917915"; + + 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, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(workflow, actualRequest.getWorkflow()); + Assert.assertEquals(workflowId, actualRequest.getWorkflowId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId1712917915"; + + 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 + @SuppressWarnings("all") + 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]"); + + Empty actualResponse = client.deleteWorkflowAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkflowRequest actualRequest = (DeleteWorkflowRequest) actualRequests.get(0); + + Assert.assertEquals(name, WorkflowName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(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 + @SuppressWarnings("all") + public void updateWorkflowTest() throws Exception { + WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + String description = "description-1724546052"; + String revisionId = "revisionId513861631"; + String serviceAccount = "serviceAccount-1948028253"; + String sourceContents = "sourceContents-1799875906"; + Workflow expectedResponse = + Workflow.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setRevisionId(revisionId) + .setServiceAccount(serviceAccount) + .setSourceContents(sourceContents) + .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 + @SuppressWarnings("all") + public void updateWorkflowExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(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/grpc-google-cloud-workflows-v1beta/pom.xml b/grpc-google-cloud-workflows-v1beta/pom.xml new file mode 100644 index 00000000..89ad2857 --- /dev/null +++ b/grpc-google-cloud-workflows-v1beta/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-workflows-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-workflows-v1beta + GRPC library for google-cloud-workflows + + com.google.cloud + google-cloud-workflows-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-workflows-v1beta + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-common-protos + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsGrpc.java b/grpc-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsGrpc.java new file mode 100644 index 00000000..034db5f3 --- /dev/null +++ b/grpc-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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.v1beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * 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/v1beta/workflows.proto") +public final class WorkflowsGrpc { + + private WorkflowsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.workflows.v1beta.Workflows"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.ListWorkflowsRequest, + com.google.cloud.workflows.v1beta.ListWorkflowsResponse> + getListWorkflowsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListWorkflows", + requestType = com.google.cloud.workflows.v1beta.ListWorkflowsRequest.class, + responseType = com.google.cloud.workflows.v1beta.ListWorkflowsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.ListWorkflowsRequest, + com.google.cloud.workflows.v1beta.ListWorkflowsResponse> + getListWorkflowsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.ListWorkflowsRequest, + com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1beta.ListWorkflowsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("ListWorkflows")) + .build(); + } + } + } + return getListWorkflowsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.GetWorkflowRequest, + com.google.cloud.workflows.v1beta.Workflow> + getGetWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetWorkflow", + requestType = com.google.cloud.workflows.v1beta.GetWorkflowRequest.class, + responseType = com.google.cloud.workflows.v1beta.Workflow.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.GetWorkflowRequest, + com.google.cloud.workflows.v1beta.Workflow> + getGetWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.GetWorkflowRequest, + com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance())) + .setSchemaDescriptor(new WorkflowsMethodDescriptorSupplier("GetWorkflow")) + .build(); + } + } + } + return getGetWorkflowMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.CreateWorkflowRequest, com.google.longrunning.Operation> + getCreateWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateWorkflow", + requestType = com.google.cloud.workflows.v1beta.CreateWorkflowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.CreateWorkflowRequest, com.google.longrunning.Operation> + getCreateWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.DeleteWorkflowRequest, com.google.longrunning.Operation> + getDeleteWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteWorkflow", + requestType = com.google.cloud.workflows.v1beta.DeleteWorkflowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest, com.google.longrunning.Operation> + getDeleteWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.UpdateWorkflowRequest, com.google.longrunning.Operation> + getUpdateWorkflowMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateWorkflow", + requestType = com.google.cloud.workflows.v1beta.UpdateWorkflowRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest, com.google.longrunning.Operation> + getUpdateWorkflowMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.ListWorkflowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListWorkflowsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public void getWorkflow( + com.google.cloud.workflows.v1beta.GetWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.CreateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.DeleteWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.UpdateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateWorkflowMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListWorkflowsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1beta.ListWorkflowsRequest, + com.google.cloud.workflows.v1beta.ListWorkflowsResponse>( + this, METHODID_LIST_WORKFLOWS))) + .addMethod( + getGetWorkflowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1beta.GetWorkflowRequest, + com.google.cloud.workflows.v1beta.Workflow>(this, METHODID_GET_WORKFLOW))) + .addMethod( + getCreateWorkflowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1beta.CreateWorkflowRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_WORKFLOW))) + .addMethod( + getDeleteWorkflowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_WORKFLOW))) + .addMethod( + getUpdateWorkflowMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListWorkflowsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public void getWorkflow( + com.google.cloud.workflows.v1beta.GetWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.CreateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.DeleteWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.UpdateWorkflowRequest request, + io.grpc.stub.StreamObserver responseObserver) { + 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.v1beta.ListWorkflowsResponse listWorkflows( + com.google.cloud.workflows.v1beta.ListWorkflowsRequest request) { + return blockingUnaryCall(getChannel(), getListWorkflowsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public com.google.cloud.workflows.v1beta.Workflow getWorkflow( + com.google.cloud.workflows.v1beta.GetWorkflowRequest request) { + return 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.v1beta.CreateWorkflowRequest request) { + return 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.v1beta.DeleteWorkflowRequest request) { + return 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.v1beta.UpdateWorkflowRequest request) { + return 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.v1beta.ListWorkflowsResponse> + listWorkflows(com.google.cloud.workflows.v1beta.ListWorkflowsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListWorkflowsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of a single Workflow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.v1beta.Workflow> + getWorkflow(com.google.cloud.workflows.v1beta.GetWorkflowRequest request) { + return 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.v1beta.CreateWorkflowRequest request) { + return 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.v1beta.DeleteWorkflowRequest request) { + return 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.v1beta.UpdateWorkflowRequest request) { + return 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.v1beta.ListWorkflowsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_WORKFLOW: + serviceImpl.getWorkflow( + (com.google.cloud.workflows.v1beta.GetWorkflowRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_WORKFLOW: + serviceImpl.createWorkflow( + (com.google.cloud.workflows.v1beta.CreateWorkflowRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_WORKFLOW: + serviceImpl.deleteWorkflow( + (com.google.cloud.workflows.v1beta.DeleteWorkflowRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_WORKFLOW: + serviceImpl.updateWorkflow( + (com.google.cloud.workflows.v1beta.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.v1beta.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.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* 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\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..26f253c7 --- /dev/null +++ b/pom.xml @@ -0,0 +1,189 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflows-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Workflows Parent + https://github.com/googleapis/java- + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.9.2 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-.git + scm:git:git@github.com:googleapis/java-.git + https://github.com/googleapis/java- + HEAD + + + https://github.com/googleapis/java-/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-workflows-parent + + + + + + com.google.cloud + google-cloud-workflows + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workflows-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflows-v1beta + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.9.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-workflows + proto-google-cloud-workflows-v1beta + grpc-google-cloud-workflows-v1beta + google-cloud-workflows-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.1.1 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-workflows-v1beta/pom.xml b/proto-google-cloud-workflows-v1beta/pom.xml new file mode 100644 index 00000000..31c65e7c --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-workflows-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-workflows-v1beta + Proto library for google-cloud-workflows + + com.google.cloud + google-cloud-workflows-parent + 0.0.1-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 + + + + \ No newline at end of file diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequest.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequest.java new file mode 100644 index 00000000..13dff27a --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequest.java @@ -0,0 +1,1184 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Request for the
+ * [CreateWorkflow][google.cloud.workflows.v1beta.Workflows.CreateWorkflow]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.CreateWorkflowRequest} + */ +public final class CreateWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.Workflow.Builder subBuilder = null; + if (workflow_ != null) { + subBuilder = workflow_.toBuilder(); + } + workflow_ = + input.readMessage( + com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.CreateWorkflowRequest.class, + com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflow_; + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow getWorkflow() { + return workflow_ == null + ? com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance() + : workflow_; + } + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.CreateWorkflowRequest other = + (com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows.CreateWorkflow]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.CreateWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.CreateWorkflowRequest) + com.google.cloud.workflows.v1beta.CreateWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.CreateWorkflowRequest.class, + com.google.cloud.workflows.v1beta.CreateWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.CreateWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.CreateWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.CreateWorkflowRequest build() { + com.google.cloud.workflows.v1beta.CreateWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.CreateWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1beta.CreateWorkflowRequest result = + new com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1beta.CreateWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.CreateWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.WorkflowOrBuilder> + workflowBuilder_; + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + public com.google.cloud.workflows.v1beta.Workflow getWorkflow() { + if (workflowBuilder_ == null) { + return workflow_ == null + ? com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance() + : workflow_; + } else { + return workflowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkflow(com.google.cloud.workflows.v1beta.Workflow value) { + if (workflowBuilder_ == null) { + if (workflow_ != null) { + workflow_ = + com.google.cloud.workflows.v1beta.Workflow.newBuilder(workflow_) + .mergeFrom(value) + .buildPartial(); + } else { + workflow_ = value; + } + onChanged(); + } else { + workflowBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1beta.Workflow.Builder getWorkflowBuilder() { + + onChanged(); + return getWorkflowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1beta.WorkflowOrBuilder getWorkflowOrBuilder() { + if (workflowBuilder_ != null) { + return workflowBuilder_.getMessageOrBuilder(); + } else { + return workflow_ == null + ? com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance() + : workflow_; + } + } + /** + * + * + *
+     * Required. Workflow to be created.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.WorkflowOrBuilder> + getWorkflowFieldBuilder() { + if (workflowBuilder_ == null) { + workflowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.CreateWorkflowRequest) + private static final com.google.cloud.workflows.v1beta.CreateWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.CreateWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.CreateWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequestOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequestOrBuilder.java new file mode 100644 index 00000000..83e33042 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface CreateWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.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.v1beta.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.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + com.google.cloud.workflows.v1beta.Workflow getWorkflow(); + /** + * + * + *
+   * Required. Workflow to be created.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequest.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequest.java new file mode 100644 index 00000000..e5f0d9d4 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequest.java @@ -0,0 +1,662 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Request for the
+ * [DeleteWorkflow][google.cloud.workflows.v1beta.Workflows.DeleteWorkflow]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.DeleteWorkflowRequest} + */ +public final class DeleteWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest.class, + com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest other = + (com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows.DeleteWorkflow]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.DeleteWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.DeleteWorkflowRequest) + com.google.cloud.workflows.v1beta.DeleteWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest.class, + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.DeleteWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.DeleteWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.DeleteWorkflowRequest build() { + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.DeleteWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1beta.DeleteWorkflowRequest result = + new com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1beta.DeleteWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.DeleteWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.DeleteWorkflowRequest) + private static final com.google.cloud.workflows.v1beta.DeleteWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.DeleteWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.DeleteWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequestOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequestOrBuilder.java new file mode 100644 index 00000000..c94cc12f --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface DeleteWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequest.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequest.java new file mode 100644 index 00000000..c98846ec --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequest.java @@ -0,0 +1,659 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Request for the
+ * [GetWorkflow][google.cloud.workflows.v1beta.Workflows.GetWorkflow] method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.GetWorkflowRequest} + */ +public final class GetWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.GetWorkflowRequest.class, + com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.GetWorkflowRequest other = + (com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows.GetWorkflow] method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.GetWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.GetWorkflowRequest) + com.google.cloud.workflows.v1beta.GetWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.GetWorkflowRequest.class, + com.google.cloud.workflows.v1beta.GetWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.GetWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.GetWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.GetWorkflowRequest build() { + com.google.cloud.workflows.v1beta.GetWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.GetWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1beta.GetWorkflowRequest result = + new com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1beta.GetWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.GetWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.GetWorkflowRequest) + private static final com.google.cloud.workflows.v1beta.GetWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.GetWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.GetWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequestOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequestOrBuilder.java new file mode 100644 index 00000000..de022af8 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface GetWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequest.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequest.java new file mode 100644 index 00000000..b9f0b29a --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequest.java @@ -0,0 +1,1343 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Request for the
+ * [ListWorkflows][google.cloud.workflows.v1beta.Workflows.ListWorkflows]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.ListWorkflowsRequest} + */ +public final class ListWorkflowsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.ListWorkflowsRequest.class, + com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.ListWorkflowsRequest other = + (com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows.ListWorkflows]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.ListWorkflowsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.ListWorkflowsRequest) + com.google.cloud.workflows.v1beta.ListWorkflowsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.ListWorkflowsRequest.class, + com.google.cloud.workflows.v1beta.ListWorkflowsRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.ListWorkflowsRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.ListWorkflowsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.ListWorkflowsRequest build() { + com.google.cloud.workflows.v1beta.ListWorkflowsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.ListWorkflowsRequest buildPartial() { + com.google.cloud.workflows.v1beta.ListWorkflowsRequest result = + new com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest) { + return mergeFrom((com.google.cloud.workflows.v1beta.ListWorkflowsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.ListWorkflowsRequest other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.ListWorkflowsRequest) + private static final com.google.cloud.workflows.v1beta.ListWorkflowsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.ListWorkflowsRequest(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequestOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequestOrBuilder.java new file mode 100644 index 00000000..ac745569 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface ListWorkflowsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponse.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponse.java new file mode 100644 index 00000000..ed00e8eb --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponse.java @@ -0,0 +1,1418 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Response for the
+ * [ListWorkflows][google.cloud.workflows.v1beta.Workflows.ListWorkflows]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.ListWorkflowsResponse} + */ +public final class ListWorkflowsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.ListWorkflowsResponse.class, + com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + @java.lang.Override + public java.util.List getWorkflowsList() { + return workflows_; + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + @java.lang.Override + public java.util.List + getWorkflowsOrBuilderList() { + return workflows_; + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + @java.lang.Override + public int getWorkflowsCount() { + return workflows_.size(); + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow getWorkflows(int index) { + return workflows_.get(index); + } + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.ListWorkflowsResponse other = + (com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows.ListWorkflows]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.ListWorkflowsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.ListWorkflowsResponse) + com.google.cloud.workflows.v1beta.ListWorkflowsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.ListWorkflowsResponse.class, + com.google.cloud.workflows.v1beta.ListWorkflowsResponse.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.ListWorkflowsResponse getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.ListWorkflowsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.ListWorkflowsResponse build() { + com.google.cloud.workflows.v1beta.ListWorkflowsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.ListWorkflowsResponse buildPartial() { + com.google.cloud.workflows.v1beta.ListWorkflowsResponse result = + new com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse) { + return mergeFrom((com.google.cloud.workflows.v1beta.ListWorkflowsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.ListWorkflowsResponse other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.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.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.WorkflowOrBuilder> + workflowsBuilder_; + + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1beta.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.v1beta.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.v1beta.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + public Builder setWorkflows(int index, com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + public Builder setWorkflows( + int index, com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + public Builder addWorkflows(com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + public Builder addWorkflows(int index, com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + public Builder addWorkflows( + com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflows = 1; + */ + public Builder addWorkflows( + int index, com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1beta.Workflow.Builder getWorkflowsBuilder(int index) { + return getWorkflowsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1beta.Workflow.Builder addWorkflowsBuilder() { + return getWorkflowsFieldBuilder() + .addBuilder(com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance()); + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + public com.google.cloud.workflows.v1beta.Workflow.Builder addWorkflowsBuilder(int index) { + return getWorkflowsFieldBuilder() + .addBuilder(index, com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance()); + } + /** + * + * + *
+     * The workflows which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + public java.util.List + getWorkflowsBuilderList() { + return getWorkflowsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.WorkflowOrBuilder> + getWorkflowsFieldBuilder() { + if (workflowsBuilder_ == null) { + workflowsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.ListWorkflowsResponse) + private static final com.google.cloud.workflows.v1beta.ListWorkflowsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.ListWorkflowsResponse(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.ListWorkflowsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponseOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponseOrBuilder.java new file mode 100644 index 00000000..d8d60a5c --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface ListWorkflowsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.ListWorkflowsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + java.util.List getWorkflowsList(); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + com.google.cloud.workflows.v1beta.Workflow getWorkflows(int index); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + int getWorkflowsCount(); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + java.util.List + getWorkflowsOrBuilderList(); + /** + * + * + *
+   * The workflows which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.v1beta.Workflow workflows = 1; + */ + com.google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java new file mode 100644 index 00000000..de22e3e3 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.v1beta; + +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; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + 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 = + PATH_TEMPLATE.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 PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + 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() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadata.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadata.java new file mode 100644 index 00000000..4ea066ee --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadata.java @@ -0,0 +1,1534 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.OperationMetadata.class, + com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.OperationMetadata other = + (com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.OperationMetadata) + com.google.cloud.workflows.v1beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.OperationMetadata.class, + com.google.cloud.workflows.v1beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.OperationMetadata build() { + com.google.cloud.workflows.v1beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.OperationMetadata buildPartial() { + com.google.cloud.workflows.v1beta.OperationMetadata result = + new com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata) { + return mergeFrom((com.google.cloud.workflows.v1beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.OperationMetadata other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.OperationMetadata) + private static final com.google.cloud.workflows.v1beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.OperationMetadata(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadataOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..b8ffa607 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequest.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequest.java new file mode 100644 index 00000000..7a746101 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequest.java @@ -0,0 +1,1046 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Request for the
+ * [UpdateWorkflow][google.cloud.workflows.v1beta.Workflows.UpdateWorkflow]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.UpdateWorkflowRequest} + */ +public final class UpdateWorkflowRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.Workflow.Builder subBuilder = null; + if (workflow_ != null) { + subBuilder = workflow_.toBuilder(); + } + workflow_ = + input.readMessage( + com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest.class, + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest.Builder.class); + } + + public static final int WORKFLOW_FIELD_NUMBER = 1; + private com.google.cloud.workflows.v1beta.Workflow workflow_; + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow getWorkflow() { + return workflow_ == null + ? com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance() + : workflow_; + } + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest other = + (com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflows.UpdateWorkflow]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.UpdateWorkflowRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.UpdateWorkflowRequest) + com.google.cloud.workflows.v1beta.UpdateWorkflowRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest.class, + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.UpdateWorkflowRequest getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.UpdateWorkflowRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.UpdateWorkflowRequest build() { + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.UpdateWorkflowRequest buildPartial() { + com.google.cloud.workflows.v1beta.UpdateWorkflowRequest result = + new com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest) { + return mergeFrom((com.google.cloud.workflows.v1beta.UpdateWorkflowRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.UpdateWorkflowRequest other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.v1beta.UpdateWorkflowRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.workflows.v1beta.Workflow workflow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.WorkflowOrBuilder> + workflowBuilder_; + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + public com.google.cloud.workflows.v1beta.Workflow getWorkflow() { + if (workflowBuilder_ == null) { + return workflow_ == null + ? com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance() + : workflow_; + } else { + return workflowBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setWorkflow(com.google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeWorkflow(com.google.cloud.workflows.v1beta.Workflow value) { + if (workflowBuilder_ == null) { + if (workflow_ != null) { + workflow_ = + com.google.cloud.workflows.v1beta.Workflow.newBuilder(workflow_) + .mergeFrom(value) + .buildPartial(); + } else { + workflow_ = value; + } + onChanged(); + } else { + workflowBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1beta.Workflow.Builder getWorkflowBuilder() { + + onChanged(); + return getWorkflowFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.v1beta.WorkflowOrBuilder getWorkflowOrBuilder() { + if (workflowBuilder_ != null) { + return workflowBuilder_.getMessageOrBuilder(); + } else { + return workflow_ == null + ? com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance() + : workflow_; + } + } + /** + * + * + *
+     * Required. Workflow to be updated.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.WorkflowOrBuilder> + getWorkflowFieldBuilder() { + if (workflowBuilder_ == null) { + workflowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.v1beta.Workflow, + com.google.cloud.workflows.v1beta.Workflow.Builder, + com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.UpdateWorkflowRequest) + private static final com.google.cloud.workflows.v1beta.UpdateWorkflowRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.UpdateWorkflowRequest(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.UpdateWorkflowRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequestOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequestOrBuilder.java new file mode 100644 index 00000000..b5ae3fec --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface UpdateWorkflowRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.UpdateWorkflowRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The workflow. + */ + com.google.cloud.workflows.v1beta.Workflow getWorkflow(); + /** + * + * + *
+   * Required. Workflow to be updated.
+   * 
+ * + * + * .google.cloud.workflows.v1beta.Workflow workflow = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workflows.v1beta.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/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/Workflow.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/Workflow.java new file mode 100644 index 00000000..a0473af9 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/Workflow.java @@ -0,0 +1,3146 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +/** + * + * + *
+ * Workflow program to be executed by Workflows.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.v1beta.Workflow} + */ +public final class Workflow extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_Workflow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.Workflow.class, + com.google.cloud.workflows.v1beta.Workflow.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of workflow deployment. More states may be
+   * added in the future.
+   * 
+ * + * Protobuf enum {@code google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.v1beta.Workflow.State result = + com.google.cloud.workflows.v1beta.Workflow.State.valueOf(state_); + return result == null ? com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_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 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.v1beta.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.v1beta.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.v1beta.Workflow)) { + return super.equals(obj); + } + com.google.cloud.workflows.v1beta.Workflow other = + (com.google.cloud.workflows.v1beta.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.v1beta.Workflow parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.Workflow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.Workflow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.Workflow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.Workflow parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflow} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.v1beta.Workflow) + com.google.cloud.workflows.v1beta.WorkflowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_Workflow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.v1beta.Workflow.class, + com.google.cloud.workflows.v1beta.Workflow.Builder.class); + } + + // Construct using com.google.cloud.workflows.v1beta.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.v1beta.WorkflowsProto + .internal_static_google_cloud_workflows_v1beta_Workflow_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow getDefaultInstanceForType() { + return com.google.cloud.workflows.v1beta.Workflow.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow build() { + com.google.cloud.workflows.v1beta.Workflow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow buildPartial() { + com.google.cloud.workflows.v1beta.Workflow result = + new com.google.cloud.workflows.v1beta.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.v1beta.Workflow) { + return mergeFrom((com.google.cloud.workflows.v1beta.Workflow) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.v1beta.Workflow other) { + if (other == com.google.cloud.workflows.v1beta.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.v1beta.Workflow parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.v1beta.Workflow.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.v1beta.Workflow.State result = + com.google.cloud.workflows.v1beta.Workflow.State.valueOf(state_); + return result == null + ? com.google.cloud.workflows.v1beta.Workflow.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the workflow deployment.
+     * 
+ * + * + * .google.cloud.workflows.v1beta.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.v1beta.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.v1beta.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 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.v1beta.Workflow) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.v1beta.Workflow) + private static final com.google.cloud.workflows.v1beta.Workflow DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.v1beta.Workflow(); + } + + public static com.google.cloud.workflows.v1beta.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.v1beta.Workflow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java new file mode 100644 index 00000000..04e77584 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java @@ -0,0 +1,211 @@ +/* + * 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.v1beta; + +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; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class WorkflowName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workflows/{workflow}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String workflow; + + 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); + } + + private WorkflowName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workflow = Preconditions.checkNotNull(builder.getWorkflow()); + } + + 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 = + PATH_TEMPLATE.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 PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("workflow", workflow); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "workflow", workflow); + } + + /** Builder for WorkflowName. */ + public static class Builder { + + private String project; + private String location; + private String workflow; + + 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() {} + + private Builder(WorkflowName workflowName) { + project = workflowName.project; + location = workflowName.location; + workflow = workflowName.workflow; + } + + public WorkflowName build() { + return new WorkflowName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof WorkflowName) { + WorkflowName that = (WorkflowName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.workflow.equals(that.workflow)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= workflow.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowOrBuilder.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowOrBuilder.java new file mode 100644 index 00000000..de3e0830 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowOrBuilder.java @@ -0,0 +1,411 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +public interface WorkflowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.v1beta.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.v1beta.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.v1beta.Workflow.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.workflows.v1beta.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 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.v1beta.Workflow.SourceCodeCase getSourceCodeCase(); +} diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsProto.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsProto.java new file mode 100644 index 00000000..0e43d1c2 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsProto.java @@ -0,0 +1,271 @@ +/* + * 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/v1beta/workflows.proto + +package com.google.cloud.workflows.v1beta; + +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_v1beta_Workflow_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_Workflow_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_Workflow_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_Workflow_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_v1beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_v1beta_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/v1beta/workflow" + + "s.proto\022\035google.cloud.workflows.v1beta\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032#googl" + + "e/longrunning/operations.proto\032 google/p" + + "rotobuf/field_mask.proto\032\037google/protobu" + + "f/timestamp.proto\"\376\004\n\010Workflow\022\014\n\004name\030\001" + + " \001(\t\022\023\n\013description\030\002 \001(\t\022A\n\005state\030\003 \001(\016" + + "2-.google.cloud.workflows.v1beta.Workflo" + + "w.StateB\003\340A\003\022\030\n\013revision_id\030\004 \001(\tB\003\340A\003\0224" + + "\n\013create_time\030\005 \001(\0132\032.google.protobuf.Ti" + + "mestampB\003\340A\003\0224\n\013update_time\030\006 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\022=\n\024revision_c" + + "reate_time\030\007 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\022C\n\006labels\030\010 \003(\01323.google.cloud" + + ".workflows.v1beta.Workflow.LabelsEntry\022\027" + + "\n\017service_account\030\t \001(\t\022\031\n\017source_conten" + + "ts\030\n \001(\tH\000\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\"*\n\005State\022\025\n\021STATE_UNSP" + + "ECIFIED\020\000\022\n\n\006ACTIVE\020\001:d\352Aa\n!workflows.go" + + "ogleapis.com/Workflow\022\n\010workf" + + "low\030\002 \001(\0132\'.google.cloud.workflows.v1bet" + + "a.WorkflowB\003\340A\002\022\030\n\013workflow_id\030\003 \001(\tB\003\340A" + + "\002\"P\n\025DeleteWorkflowRequest\0227\n\004name\030\001 \001(\t" + + "B)\340A\002\372A#\n!workflows.googleapis.com/Workf" + + "low\"\210\001\n\025UpdateWorkflowRequest\022>\n\010workflo" + + "w\030\001 \001(\0132\'.google.cloud.workflows.v1beta." + + "WorkflowB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.goo" + + "gle.protobuf.FieldMask\"\245\001\n\021OperationMeta" + + "data\022/\n\013create_time\030\001 \001(\0132\032.google.proto" + + "buf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\022\016\n\006target\030\003 \001(\t\022\014\n\004v" + + "erb\030\004 \001(\t\022\023\n\013api_version\030\005 \001(\t2\371\010\n\tWorkf" + + "lows\022\276\001\n\rListWorkflows\0223.google.cloud.wo" + + "rkflows.v1beta.ListWorkflowsRequest\0324.go" + + "ogle.cloud.workflows.v1beta.ListWorkflow" + + "sResponse\"B\202\323\344\223\0023\0221/v1beta/{parent=proje" + + "cts/*/locations/*}/workflows\332A\006parent\022\253\001" + + "\n\013GetWorkflow\0221.google.cloud.workflows.v" + + "1beta.GetWorkflowRequest\032\'.google.cloud." + + "workflows.v1beta.Workflow\"@\202\323\344\223\0023\0221/v1be" + + "ta/{name=projects/*/locations/*/workflow" + + "s/*}\332A\004name\022\351\001\n\016CreateWorkflow\0224.google." + + "cloud.workflows.v1beta.CreateWorkflowReq" + + "uest\032\035.google.longrunning.Operation\"\201\001\202\323" + + "\344\223\002=\"1/v1beta/{parent=projects/*/locatio" + + "ns/*}/workflows:\010workflow\332A\033parent,workf" + + "low,workflow_id\312A\035\n\010Workflow\022\021OperationM" + + "etadata\022\324\001\n\016DeleteWorkflow\0224.google.clou" + + "d.workflows.v1beta.DeleteWorkflowRequest" + + "\032\035.google.longrunning.Operation\"m\202\323\344\223\0023*" + + "1/v1beta/{name=projects/*/locations/*/wo" + + "rkflows/*}\332A\004name\312A*\n\025google.protobuf.Em" + + "pty\022\021OperationMetadata\022\353\001\n\016UpdateWorkflo" + + "w\0224.google.cloud.workflows.v1beta.Update" + + "WorkflowRequest\032\035.google.longrunning.Ope" + + "ration\"\203\001\202\323\344\223\002F2:/v1beta/{workflow.name=" + + "projects/*/locations/*/workflows/*}:\010wor" + + "kflow\332A\024workflow,update_mask\312A\035\n\010Workflo" + + "w\022\021OperationMetadata\032L\312A\030workflows.googl" + + "eapis.com\322A.https://www.googleapis.com/a" + + "uth/cloud-platformB}\n!com.google.cloud.w" + + "orkflows.v1betaB\016WorkflowsProtoP\001ZFgoogl" + + "e.golang.org/genproto/googleapis/cloud/w" + + "orkflows/v1beta;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_v1beta_Workflow_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_workflows_v1beta_Workflow_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_Workflow_descriptor, + new java.lang.String[] { + "Name", + "Description", + "State", + "RevisionId", + "CreateTime", + "UpdateTime", + "RevisionCreateTime", + "Labels", + "ServiceAccount", + "SourceContents", + "SourceCode", + }); + internal_static_google_cloud_workflows_v1beta_Workflow_LabelsEntry_descriptor = + internal_static_google_cloud_workflows_v1beta_Workflow_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_workflows_v1beta_Workflow_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_Workflow_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_ListWorkflowsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_ListWorkflowsResponse_descriptor, + new java.lang.String[] { + "Workflows", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_GetWorkflowRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_CreateWorkflowRequest_descriptor, + new java.lang.String[] { + "Parent", "Workflow", "WorkflowId", + }); + internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_DeleteWorkflowRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_UpdateWorkflowRequest_descriptor, + new java.lang.String[] { + "Workflow", "UpdateMask", + }); + internal_static_google_cloud_workflows_v1beta_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_workflows_v1beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_workflows_v1beta_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/proto-google-cloud-workflows-v1beta/src/main/proto/google/cloud/workflows/v1beta/workflows.proto b/proto-google-cloud-workflows-v1beta/src/main/proto/google/cloud/workflows/v1beta/workflows.proto new file mode 100644 index 00000000..5308fa73 --- /dev/null +++ b/proto-google-cloud-workflows-v1beta/src/main/proto/google/cloud/workflows/v1beta/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.v1beta; + +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/v1beta;workflows"; +option java_multiple_files = true; +option java_outer_classname = "WorkflowsProto"; +option java_package = "com.google.cloud.workflows.v1beta"; + +// 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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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: "/v1beta/{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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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.v1beta.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/renovate.json b/renovate.json new file mode 100644 index 00000000..e09b9c7f --- /dev/null +++ b/renovate.json @@ -0,0 +1,81 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-workflows", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} \ No newline at end of file diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..3f5a7435 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + workflows-install-without-bom + jar + Google Cloud Workflows Install Without Bom + https://github.com/googleapis/java-workflows + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-workflows + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..4b2d8d99 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflows-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Workflows Samples Parent + https://github.com/googleapis/java-workflows + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..5bc0c0e2 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + workflows-snapshot + jar + Google Cloud Workflows Snapshot Samples + https://github.com/googleapis/java-workflows + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-workflows + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..985e94f9 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + workflows-snippets + jar + Google Cloud Workflows Snippets + https://github.com/googleapis/java-workflows + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-workflows + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..8dc9b2d8 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,133 @@ +{ + "sources": [ + { + "git": { + "name": "." + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "ba5a928ab823d97dc6b7042ff32130d19b002f75", + "internalRef": "331550506" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "workflows", + "apiVersion": "v1beta", + "language": "java", + "generator": "bazel" + } + } + ], + "generatedFiles": [ + ".github/CODEOWNERS", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/release-please.yml", + ".github/trusted-contribution.yml", + ".github/workflows/ci.yaml", + ".github/workflows/samples.yaml", + ".kokoro/build.bat", + ".kokoro/build.sh", + ".kokoro/coerce_logs.sh", + ".kokoro/common.cfg", + ".kokoro/common.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/java8.cfg", + ".kokoro/dependencies.sh", + ".kokoro/linkage-monitor.sh", + ".kokoro/nightly/common.cfg", + ".kokoro/nightly/integration.cfg", + ".kokoro/nightly/java11.cfg", + ".kokoro/nightly/java7.cfg", + ".kokoro/nightly/java8-osx.cfg", + ".kokoro/nightly/java8-win.cfg", + ".kokoro/nightly/java8.cfg", + ".kokoro/nightly/samples.cfg", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/clirr.cfg", + ".kokoro/presubmit/common.cfg", + ".kokoro/presubmit/dependencies.cfg", + ".kokoro/presubmit/integration.cfg", + ".kokoro/presubmit/java11.cfg", + ".kokoro/presubmit/java7.cfg", + ".kokoro/presubmit/java8-osx.cfg", + ".kokoro/presubmit/java8-win.cfg", + ".kokoro/presubmit/java8.cfg", + ".kokoro/presubmit/linkage-monitor.cfg", + ".kokoro/presubmit/lint.cfg", + ".kokoro/presubmit/samples.cfg", + ".kokoro/release/bump_snapshot.cfg", + ".kokoro/release/common.cfg", + ".kokoro/release/common.sh", + ".kokoro/release/drop.cfg", + ".kokoro/release/drop.sh", + ".kokoro/release/promote.cfg", + ".kokoro/release/promote.sh", + ".kokoro/release/publish_javadoc.cfg", + ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/snapshot.cfg", + ".kokoro/release/snapshot.sh", + ".kokoro/release/stage.cfg", + ".kokoro/release/stage.sh", + ".kokoro/trampoline.sh", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "codecov.yaml", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java", + "google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java", + "google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java", + "google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java", + "grpc-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsGrpc.java", + "java.header", + "license-checks.xml", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequest.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/CreateWorkflowRequestOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequest.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/DeleteWorkflowRequestOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequest.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/GetWorkflowRequestOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequest.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsRequestOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponse.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/ListWorkflowsResponseOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadata.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/OperationMetadataOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequest.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/UpdateWorkflowRequestOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/Workflow.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowOrBuilder.java", + "proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsProto.java", + "proto-google-cloud-workflows-v1beta/src/main/proto/google/cloud/workflows/v1beta/workflows.proto", + "renovate.json", + "samples/install-without-bom/pom.xml", + "samples/pom.xml", + "samples/snapshot/pom.xml", + "samples/snippets/pom.xml" + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..6e14a120 --- /dev/null +++ b/synth.py @@ -0,0 +1,32 @@ +# 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/versions.txt b/versions.txt new file mode 100644 index 00000000..807ae661 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-workflows:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-workflows-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-workflows-v1beta:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file