From b6184fcca10031552a6d6b82df668963a61826d8 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 28 Oct 2020 15:05:45 -0700 Subject: [PATCH] feat: initial generation --- .github/CODEOWNERS | 10 + .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/readme/synth.py | 19 + .github/release-please.yml | 2 + .github/snippet-bot.yml | 0 .github/trusted-contribution.yml | 2 + .github/workflows/approve-readme.yaml | 54 + .github/workflows/auto-release.yaml | 88 + .github/workflows/ci.yaml | 79 + .github/workflows/formatting.yaml | 25 + .github/workflows/samples.yaml | 14 + .gitignore | 17 + .kokoro/build.bat | 3 + .kokoro/build.sh | 118 + .kokoro/coerce_logs.sh | 38 + .kokoro/common.cfg | 13 + .kokoro/common.sh | 59 + .kokoro/continuous/common.cfg | 25 + .kokoro/continuous/java8.cfg | 12 + .kokoro/continuous/readme.cfg | 55 + .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/readme.sh | 36 + .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 | 94 + CONTRIBUTING.md | 139 + LICENSE | 202 + README.md | 143 + codecov.yaml | 4 + google-cloud-workflow-executions-bom/pom.xml | 97 + google-cloud-workflow-executions/pom.xml | 111 + .../executions/v1beta/ExecutionsClient.java | 693 ++++ .../executions/v1beta/ExecutionsSettings.java | 216 ++ .../executions/v1beta/package-info.java | 42 + .../v1beta/stub/ExecutionsStub.java | 64 + .../v1beta/stub/ExecutionsStubSettings.java | 419 +++ .../stub/GrpcExecutionsCallableFactory.java | 115 + .../v1beta/stub/GrpcExecutionsStub.java | 263 ++ .../v1beta/ExecutionsClientTest.java | 274 ++ .../executions/v1beta/MockExecutions.java | 57 + .../executions/v1beta/MockExecutionsImpl.java | 118 + .../pom.xml | 65 + .../executions/v1beta/ExecutionsGrpc.java | 739 ++++ java.header | 15 + license-checks.xml | 10 + pom.xml | 189 + .../pom.xml | 42 + .../v1beta/CancelExecutionRequest.java | 680 ++++ .../CancelExecutionRequestOrBuilder.java | 58 + .../v1beta/CreateExecutionRequest.java | 983 +++++ .../CreateExecutionRequestOrBuilder.java | 99 + .../executions/v1beta/Execution.java | 3330 +++++++++++++++++ .../executions/v1beta/ExecutionName.java | 243 ++ .../executions/v1beta/ExecutionOrBuilder.java | 285 ++ .../executions/v1beta/ExecutionView.java | 182 + .../executions/v1beta/ExecutionsProto.java | 238 ++ .../v1beta/GetExecutionRequest.java | 855 +++++ .../v1beta/GetExecutionRequestOrBuilder.java | 89 + .../v1beta/ListExecutionsRequest.java | 1158 ++++++ .../ListExecutionsRequestOrBuilder.java | 135 + .../v1beta/ListExecutionsResponse.java | 1167 ++++++ .../ListExecutionsResponseOrBuilder.java | 104 + .../executions/v1beta/WorkflowName.java | 211 ++ .../executions/v1beta/executions.proto | 252 ++ renovate.json | 73 + samples/install-without-bom/pom.xml | 84 + samples/pom.xml | 56 + samples/snapshot/pom.xml | 83 + samples/snippets/pom.xml | 47 + synth.metadata | 138 + synth.py | 34 + versions.txt | 6 + 110 files changed, 16424 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/readme/synth.py create mode 100644 .github/release-please.yml create mode 100644 .github/snippet-bot.yml create mode 100644 .github/trusted-contribution.yml create mode 100644 .github/workflows/approve-readme.yaml create mode 100644 .github/workflows/auto-release.yaml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/formatting.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 100644 .kokoro/continuous/readme.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 100755 .kokoro/readme.sh 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-workflow-executions-bom/pom.xml create mode 100644 google-cloud-workflow-executions/pom.xml create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClient.java create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsSettings.java create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/package-info.java create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStub.java create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStubSettings.java create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsCallableFactory.java create mode 100644 google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsStub.java create mode 100644 google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClientTest.java create mode 100644 google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutions.java create mode 100644 google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutionsImpl.java create mode 100644 grpc-google-cloud-workflow-executions-v1beta/pom.xml create mode 100644 grpc-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsGrpc.java create mode 100644 java.header create mode 100644 license-checks.xml create mode 100644 pom.xml create mode 100644 proto-google-cloud-workflow-executions-v1beta/pom.xml create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequest.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequestOrBuilder.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequest.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequestOrBuilder.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/Execution.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionName.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionOrBuilder.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionView.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsProto.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequest.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequestOrBuilder.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequest.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequestOrBuilder.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponse.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponseOrBuilder.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/WorkflowName.java create mode 100644 proto-google-cloud-workflow-executions-v1beta/src/main/proto/google/cloud/workflows/executions/v1beta/executions.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..30fdb7b9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,10 @@ +# 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 + +* @googleapis/yoshi-java + +# 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..451a79b9 --- /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-workflow-executions/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-executions 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..a575c243 --- /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-workflow-executions/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/readme/synth.py b/.github/readme/synth.py new file mode 100644 index 00000000..7b48cc28 --- /dev/null +++ b/.github/readme/synth.py @@ -0,0 +1,19 @@ +# 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 the README for this library.""" + +from synthtool.languages import java + +java.custom_templates(["java_library/README.md"]) 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/snippet-bot.yml b/.github/snippet-bot.yml new file mode 100644 index 00000000..e69de29b 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/approve-readme.yaml b/.github/workflows/approve-readme.yaml new file mode 100644 index 00000000..e2d841d6 --- /dev/null +++ b/.github/workflows/approve-readme.yaml @@ -0,0 +1,54 @@ +on: + pull_request: +name: auto-merge-readme +jobs: + approve: + runs-on: ubuntu-latest + if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' + steps: + - uses: actions/github-script@v3.0.0 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + script: | + // only approve PRs from yoshi-automation + if (context.payload.pull_request.user.login !== "yoshi-automation") { + return; + } + + // only approve PRs like "chore: release " + if (!context.payload.pull_request.title === "chore: regenerate README") { + return; + } + + // only approve PRs with README.md and synth.metadata changes + const files = new Set( + ( + await github.paginate( + github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }) + ) + ).map(file => file.filename) + ); + if (files.size != 2 || !files.has("README.md") || !files.has(".github/readme/synth.metadata/synth.metadata")) { + return; + } + + // approve README regeneration PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped PR!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach automerge label + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['automerge'] + }); diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml new file mode 100644 index 00000000..bc1554ae --- /dev/null +++ b/.github/workflows/auto-release.yaml @@ -0,0 +1,88 @@ +on: + pull_request: +name: auto-release +jobs: + approve: + runs-on: ubuntu-latest + if: contains(github.head_ref, 'release-v') + steps: + - uses: actions/github-script@v3.0.0 + with: + github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} + debug: true + script: | + // only approve PRs from release-please[bot] + if (context.payload.pull_request.user.login !== "release-please[bot]") { + return; + } + + // only approve PRs like "chore: release " + if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + return; + } + + // only approve PRs with pom.xml and versions.txt changes + const filesPromise = github.pulls.listFiles.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + }); + const changed_files = await github.paginate(filesPromise) + + if ( changed_files.length < 1 ) { + console.log( "Not proceeding since PR is empty!" ) + return; + } + + if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { + console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) + return; + } + + // trigger auto-release when + // 1) it is a SNAPSHOT release (auto-generated post regular release) + // 2) there are dependency updates only + // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) + if ( + context.payload.pull_request.body.includes("Fix") || + context.payload.pull_request.body.includes("Build") || + context.payload.pull_request.body.includes("Documentation") || + context.payload.pull_request.body.includes("BREAKING CHANGES") || + context.payload.pull_request.body.includes("Features") + ) { + console.log( "Not auto-releasing since it is not a dependency-update-only release." ); + return; + } + + const promise = github.pulls.list.endpoint({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + const open_pulls = await github.paginate(promise) + + if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { + for ( const pull of open_pulls ) { + if ( pull.title.startsWith("deps: update dependency") ) { + console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); + return; + } + } + } + + // approve release PR + await github.pulls.createReview({ + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Rubber stamped release!', + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }); + + // attach kokoro:force-run and automerge labels + await github.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: ['kokoro:force-run', 'automerge'] + }); 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/formatting.yaml b/.github/workflows/formatting.yaml new file mode 100644 index 00000000..d4d367cf --- /dev/null +++ b/.github/workflows/formatting.yaml @@ -0,0 +1,25 @@ +on: + pull_request_target: + types: [opened, synchronize] + branches: + - master +name: format +jobs: + format-code: + runs-on: ubuntu-latest + env: + ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - uses: actions/setup-java@v1 + with: + java-version: 11 + - run: "mvn com.coveo:fmt-maven-plugin:format" + - uses: googleapis/code-suggester@v1.8.0 + with: + command: review + pull_number: ${{ github.event.pull_request.number }} + git_dir: '.' diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml new file mode 100644 index 00000000..c46230a7 --- /dev/null +++ b/.github/workflows/samples.yaml @@ -0,0 +1,14 @@ +on: + pull_request: +name: samples +jobs: + checkstyle: + 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..1d352fe2 --- /dev/null +++ b/.kokoro/build.sh @@ -0,0 +1,118 @@ +#!/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) + SAMPLES_DIR=samples + # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. + if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]] + then + SAMPLES_DIR=samples/snapshot + fi + + if [[ -f ${SAMPLES_DIR}/pom.xml ]] + then + pushd ${SAMPLES_DIR} + 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-workflow-executions +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..b76d1ac4 --- /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-workflow-executions/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflow-executions/.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..4d3e5210 --- /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-workflow-executions/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflow-executions/.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/continuous/readme.cfg b/.kokoro/continuous/readme.cfg new file mode 100644 index 00000000..c43bb0ec --- /dev/null +++ b/.kokoro/continuous/readme.cfg @@ -0,0 +1,55 @@ +# 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. + +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflow-executions/.kokoro/readme.sh" +} + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + regex: "**/*sponge_log.log" + } +} + +# The github token is stored here. +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + # TODO(theacodes): remove this after secrets have globally propagated + backend_type: FASTCONFIGPUSH + } + } +} + +# Common env vars for all repositories and builds. +env_vars: { + key: "GITHUB_USER" + value: "yoshi-automation" +} +env_vars: { + key: "GITHUB_EMAIL" + value: "yoshi-automation@google.com" +} 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..4d3e5210 --- /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-workflow-executions/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflow-executions/.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..6d1b77d0 --- /dev/null +++ b/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflow-executions/.kokoro/build.sh" diff --git a/.kokoro/nightly/java8-win.cfg b/.kokoro/nightly/java8-win.cfg new file mode 100644 index 00000000..63a4d57e --- /dev/null +++ b/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflow-executions/.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..44b9aa84 --- /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-workflow-executions/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflow-executions/.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..808c81ff --- /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-workflow-executions/.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..6d1b77d0 --- /dev/null +++ b/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflow-executions/.kokoro/build.sh" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 00000000..63a4d57e --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-workflow-executions/.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..29b6cc78 --- /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-workflow-executions/.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/readme.sh b/.kokoro/readme.sh new file mode 100755 index 00000000..85517d22 --- /dev/null +++ b/.kokoro/readme.sh @@ -0,0 +1,36 @@ +#!/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 + +cd ${KOKORO_ARTIFACTS_DIR}/github/java-workflow-executions + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Kokoro exposes this as a file, but the scripts expect just a plain variable. +export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) + +# Setup git credentials +echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials +git config --global credential.helper 'store --file ~/.git-credentials' + +python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool +python3.6 -m autosynth.synth \ + --repository=googleapis/java-workflow-executions \ + --synth-file-name=.github/readme/synth.py \ + --metadata-path=.github/readme/synth.metadata \ + --pr-title="chore: regenerate README" \ + --branch-suffix="readme" \ 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..f7784cea --- /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-workflow-executions/.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-workflow-executions/.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..ebbbdee7 --- /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-workflow-executions/.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..5fb9ebb2 --- /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-workflow-executions/.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..c48474e9 --- /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-workflow-executions/.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..c4436aac --- /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-workflow-executions/.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..22ea662d --- /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-workflow-executions +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/reference + +# 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..af32b840 --- /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-workflow-executions/.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..7a5ebeb8 --- /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-workflow-executions/.kokoro/release/stage.sh" +} + +# Need to save the properties file +action { + define_artifacts { + regex: "github/java-workflow-executions/target/nexus-staging/staging/*.properties" + strip_prefix: "github/java-workflow-executions" + } +} + +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..433541dc --- /dev/null +++ b/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "workflows-executions", + "name_pretty": "Cloud Workflow Executions", + "product_documentation": "https://cloud.google.com/workflows", + "api_description": "allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows.", + "client_documentation": "https://googleapis.dev/java/google-cloud-workflow-executions/latest/index.html", + "release_level": "beta", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-workflow-executions", + "repo_short": "java-workflow-executions", + "distribution_name": "com.google.cloud:google-cloud-workflow-executions", + "api_id": "workflows-executions.googleapis.com", + "requires_billing": true +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2add2547 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# 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 *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. 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 to 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..e4f92ce7 --- /dev/null +++ b/README.md @@ -0,0 +1,143 @@ +# Google Cloud Workflow Executions Client for Java + +Java idiomatic client for [Cloud Workflow Executions][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-workflow-executions + 0.0.0 + +``` + +[//]: # ({x-version-update-start:google-cloud-workflow-executions:released}) + +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-workflow-executions:0.0.0' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-workflow-executions" % "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 Workflow Executions [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Workflow Executions. +[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-workflow-executions` library. See the [Quickstart](#quickstart) section +to add `google-cloud-workflow-executions` as a dependency in your code. + +## About Cloud Workflow Executions + + +[Cloud Workflow Executions][product-docs] allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows. + +See the [Cloud Workflow Executions client library docs][javadocs] to learn how to +use this Cloud Workflow Executions Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Workflow Executions 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-workflow-executions/latest/index.html +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflow-executions/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-workflow-executions.svg +[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-workflow-executions&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-workflow-executions/blob/master/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-workflow-executions/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-workflow-executions/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-executions.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-workflow-executions-bom/pom.xml b/google-cloud-workflow-executions-bom/pom.xml new file mode 100644 index 00000000..ba342fbc --- /dev/null +++ b/google-cloud-workflow-executions-bom/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflow-executions-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-shared-config + 0.9.4 + + + Google Cloud Workflow Executions BOM + https://github.com/googleapis/java-workflow-executions + + BOM for Cloud Workflow Executions + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-workflow-executions.git + scm:git:git@github.com:googleapis/java-workflow-executions.git + https://github.com/googleapis/java-workflow-executions + + + + 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-workflow-executions + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workflow-executions-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1beta + 0.0.1-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + \ No newline at end of file diff --git a/google-cloud-workflow-executions/pom.xml b/google-cloud-workflow-executions/pom.xml new file mode 100644 index 00000000..db2b2da4 --- /dev/null +++ b/google-cloud-workflow-executions/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflow-executions + 0.0.1-SNAPSHOT + jar + Google Cloud Workflow Executions + https://github.com/googleapis/java-workflow-executions + allows you to ochestrate and automate Google Cloud and HTTP-based API services with serverless workflows. + + com.google.cloud + google-cloud-workflow-executions-parent + 0.0.1-SNAPSHOT + + + google-cloud-workflow-executions + + + + 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-workflow-executions-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-workflow-executions-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-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClient.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClient.java new file mode 100644 index 00000000..b882c215 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClient.java @@ -0,0 +1,693 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1beta.stub.ExecutionsStub; +import com.google.cloud.workflows.executions.v1beta.stub.ExecutionsStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Executions is used to start and manage running instances of + * [Workflows][google.cloud.workflows.v1beta.Workflow] called executions. + * + *

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

+ * 
+ * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+ *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Execution execution = Execution.newBuilder().build();
+ *   Execution response = executionsClient.createExecution(parent, execution);
+ * }
+ * 
+ * 
+ * + *

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

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of ExecutionsSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ExecutionsSettings executionsSettings =
+ *     ExecutionsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ExecutionsClient executionsClient =
+ *     ExecutionsClient.create(executionsSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ExecutionsSettings executionsSettings =
+ *     ExecutionsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ExecutionsClient executionsClient =
+ *     ExecutionsClient.create(executionsSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ExecutionsClient implements BackgroundResource { + private final ExecutionsSettings settings; + private final ExecutionsStub stub; + + /** Constructs an instance of ExecutionsClient with default settings. */ + public static final ExecutionsClient create() throws IOException { + return create(ExecutionsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ExecutionsClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ExecutionsClient create(ExecutionsSettings settings) throws IOException { + return new ExecutionsClient(settings); + } + + /** + * Constructs an instance of ExecutionsClient, using the given stub for making calls. This is for + * advanced usage - prefer to use ExecutionsSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ExecutionsClient create(ExecutionsStub stub) { + return new ExecutionsClient(stub); + } + + /** + * Constructs an instance of ExecutionsClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected ExecutionsClient(ExecutionsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ExecutionsStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ExecutionsClient(ExecutionsStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ExecutionsSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ExecutionsStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of executions which belong to the workflow with the given name. The method + * returns executions of all workflow revisions. Returned executions are ordered by their start + * time (newest first). + * + *

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+   *   Execution execution = Execution.newBuilder().build();
+   *   CreateExecutionRequest request = CreateExecutionRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setExecution(execution)
+   *     .build();
+   *   Execution response = executionsClient.createExecution(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution createExecution(CreateExecutionRequest request) { + return createExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new execution using the latest revision of the given workflow. + * + *

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]");
+   *   GetExecutionRequest request = GetExecutionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Execution response = executionsClient.getExecution(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution getExecution(GetExecutionRequest request) { + return getExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns an execution of the given name. + * + *

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


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

Sample code: + * + *


+   * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+   *   ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]");
+   *   CancelExecutionRequest request = CancelExecutionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Execution response = executionsClient.cancelExecution(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Execution cancelExecution(CancelExecutionRequest request) { + return cancelExecutionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Cancels an execution of the given name. + * + *

Sample code: + * + *


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

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

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

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

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

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

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listExecutions. */ + public PagedCallSettings.Builder< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings() { + return getStubSettingsBuilder().listExecutionsSettings(); + } + + /** Returns the builder for the settings used for calls to createExecution. */ + public UnaryCallSettings.Builder createExecutionSettings() { + return getStubSettingsBuilder().createExecutionSettings(); + } + + /** Returns the builder for the settings used for calls to getExecution. */ + public UnaryCallSettings.Builder getExecutionSettings() { + return getStubSettingsBuilder().getExecutionSettings(); + } + + /** Returns the builder for the settings used for calls to cancelExecution. */ + public UnaryCallSettings.Builder cancelExecutionSettings() { + return getStubSettingsBuilder().cancelExecutionSettings(); + } + + @Override + public ExecutionsSettings build() throws IOException { + return new ExecutionsSettings(this); + } + } +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/package-info.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/package-info.java new file mode 100644 index 00000000..b6ddc89b --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/package-info.java @@ -0,0 +1,42 @@ +/* + * 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 Workflow Executions API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

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

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

Sample for ExecutionsClient: + * + *

+ * 
+ * try (ExecutionsClient executionsClient = ExecutionsClient.create()) {
+ *   WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
+ *   Execution execution = Execution.newBuilder().build();
+ *   Execution response = executionsClient.createExecution(parent, execution);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.workflows.executions.v1beta; + +import javax.annotation.Generated; diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStub.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStub.java new file mode 100644 index 00000000..81c9d50c --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStub.java @@ -0,0 +1,64 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.v1beta.stub; + +import static com.google.cloud.workflows.executions.v1beta.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.Execution; +import com.google.cloud.workflows.executions.v1beta.GetExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest; +import com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Workflow Executions 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 ExecutionsStub implements BackgroundResource { + + public UnaryCallable + listExecutionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listExecutionsPagedCallable()"); + } + + public UnaryCallable listExecutionsCallable() { + throw new UnsupportedOperationException("Not implemented: listExecutionsCallable()"); + } + + public UnaryCallable createExecutionCallable() { + throw new UnsupportedOperationException("Not implemented: createExecutionCallable()"); + } + + public UnaryCallable getExecutionCallable() { + throw new UnsupportedOperationException("Not implemented: getExecutionCallable()"); + } + + public UnaryCallable cancelExecutionCallable() { + throw new UnsupportedOperationException("Not implemented: cancelExecutionCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStubSettings.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStubSettings.java new file mode 100644 index 00000000..261afb88 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStubSettings.java @@ -0,0 +1,419 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.v1beta.stub; + +import static com.google.cloud.workflows.executions.v1beta.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.Execution; +import com.google.cloud.workflows.executions.v1beta.GetExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest; +import com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ExecutionsStub}. + * + *

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

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

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

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

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

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listExecutions. */ + public PagedCallSettings.Builder< + ListExecutionsRequest, ListExecutionsResponse, ListExecutionsPagedResponse> + listExecutionsSettings() { + return listExecutionsSettings; + } + + /** Returns the builder for the settings used for calls to createExecution. */ + public UnaryCallSettings.Builder createExecutionSettings() { + return createExecutionSettings; + } + + /** Returns the builder for the settings used for calls to getExecution. */ + public UnaryCallSettings.Builder getExecutionSettings() { + return getExecutionSettings; + } + + /** Returns the builder for the settings used for calls to cancelExecution. */ + public UnaryCallSettings.Builder cancelExecutionSettings() { + return cancelExecutionSettings; + } + + @Override + public ExecutionsStubSettings build() throws IOException { + return new ExecutionsStubSettings(this); + } + } +} diff --git a/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsCallableFactory.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsCallableFactory.java new file mode 100644 index 00000000..496f6416 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsCallableFactory.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.executions.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 Workflow Executions 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 GrpcExecutionsCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings 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-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsStub.java b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsStub.java new file mode 100644 index 00000000..985c7342 --- /dev/null +++ b/google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsStub.java @@ -0,0 +1,263 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.v1beta.stub; + +import static com.google.cloud.workflows.executions.v1beta.ExecutionsClient.ListExecutionsPagedResponse; + +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.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.Execution; +import com.google.cloud.workflows.executions.v1beta.GetExecutionRequest; +import com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest; +import com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse; +import com.google.common.collect.ImmutableMap; +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 Workflow Executions 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 GrpcExecutionsStub extends ExecutionsStub { + + private static final MethodDescriptor + listExecutionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workflows.executions.v1beta.Executions/ListExecutions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListExecutionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListExecutionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createExecutionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workflows.executions.v1beta.Executions/CreateExecution") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateExecutionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Execution.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getExecutionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.workflows.executions.v1beta.Executions/GetExecution") + .setRequestMarshaller(ProtoUtils.marshaller(GetExecutionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Execution.getDefaultInstance())) + .build(); + private static final MethodDescriptor + cancelExecutionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.workflows.executions.v1beta.Executions/CancelExecution") + .setRequestMarshaller( + ProtoUtils.marshaller(CancelExecutionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Execution.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable listExecutionsCallable; + private final UnaryCallable + listExecutionsPagedCallable; + private final UnaryCallable createExecutionCallable; + private final UnaryCallable getExecutionCallable; + private final UnaryCallable cancelExecutionCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcExecutionsStub create(ExecutionsStubSettings settings) + throws IOException { + return new GrpcExecutionsStub(settings, ClientContext.create(settings)); + } + + public static final GrpcExecutionsStub create(ClientContext clientContext) throws IOException { + return new GrpcExecutionsStub(ExecutionsStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcExecutionsStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcExecutionsStub( + ExecutionsStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcExecutionsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcExecutionsStub(ExecutionsStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcExecutionsCallableFactory()); + } + + /** + * Constructs an instance of GrpcExecutionsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcExecutionsStub( + ExecutionsStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings + listExecutionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listExecutionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListExecutionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createExecutionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createExecutionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateExecutionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getExecutionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getExecutionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetExecutionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings cancelExecutionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(cancelExecutionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CancelExecutionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.listExecutionsCallable = + callableFactory.createUnaryCallable( + listExecutionsTransportSettings, settings.listExecutionsSettings(), clientContext); + this.listExecutionsPagedCallable = + callableFactory.createPagedCallable( + listExecutionsTransportSettings, settings.listExecutionsSettings(), clientContext); + this.createExecutionCallable = + callableFactory.createUnaryCallable( + createExecutionTransportSettings, settings.createExecutionSettings(), clientContext); + this.getExecutionCallable = + callableFactory.createUnaryCallable( + getExecutionTransportSettings, settings.getExecutionSettings(), clientContext); + this.cancelExecutionCallable = + callableFactory.createUnaryCallable( + cancelExecutionTransportSettings, settings.cancelExecutionSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable + listExecutionsPagedCallable() { + return listExecutionsPagedCallable; + } + + public UnaryCallable listExecutionsCallable() { + return listExecutionsCallable; + } + + public UnaryCallable createExecutionCallable() { + return createExecutionCallable; + } + + public UnaryCallable getExecutionCallable() { + return getExecutionCallable; + } + + public UnaryCallable cancelExecutionCallable() { + return cancelExecutionCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClientTest.java b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClientTest.java new file mode 100644 index 00000000..b14dbfa2 --- /dev/null +++ b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClientTest.java @@ -0,0 +1,274 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.v1beta; + +import static com.google.cloud.workflows.executions.v1beta.ExecutionsClient.ListExecutionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +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 ExecutionsClientTest { + private static MockExecutions mockExecutions; + private static MockServiceHelper serviceHelper; + private ExecutionsClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockExecutions = new MockExecutions(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockExecutions)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ExecutionsSettings settings = + ExecutionsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ExecutionsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listExecutionsTest() { + String nextPageToken = ""; + Execution executionsElement = Execution.newBuilder().build(); + List executions = Arrays.asList(executionsElement); + ListExecutionsResponse expectedResponse = + ListExecutionsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllExecutions(executions) + .build(); + mockExecutions.addResponse(expectedResponse); + + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + + ListExecutionsPagedResponse pagedListResponse = client.listExecutions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExecutionsList().get(0), resources.get(0)); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExecutionsRequest actualRequest = (ListExecutionsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, WorkflowName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listExecutionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + + client.listExecutions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createExecutionTest() { + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + String argument = "argument-1589682499"; + String result = "result-934426595"; + String workflowRevisionId = "workflowRevisionId-1453295745"; + Execution expectedResponse = + Execution.newBuilder() + .setName(name.toString()) + .setArgument(argument) + .setResult(result) + .setWorkflowRevisionId(workflowRevisionId) + .build(); + mockExecutions.addResponse(expectedResponse); + + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + Execution execution = Execution.newBuilder().build(); + + Execution actualResponse = client.createExecution(parent, execution); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExecutionRequest actualRequest = (CreateExecutionRequest) actualRequests.get(0); + + Assert.assertEquals(parent, WorkflowName.parse(actualRequest.getParent())); + Assert.assertEquals(execution, actualRequest.getExecution()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createExecutionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + WorkflowName parent = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + Execution execution = Execution.newBuilder().build(); + + client.createExecution(parent, execution); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getExecutionTest() { + ExecutionName name2 = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + String argument = "argument-1589682499"; + String result = "result-934426595"; + String workflowRevisionId = "workflowRevisionId-1453295745"; + Execution expectedResponse = + Execution.newBuilder() + .setName(name2.toString()) + .setArgument(argument) + .setResult(result) + .setWorkflowRevisionId(workflowRevisionId) + .build(); + mockExecutions.addResponse(expectedResponse); + + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + + Execution actualResponse = client.getExecution(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExecutionRequest actualRequest = (GetExecutionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ExecutionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getExecutionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + + client.getExecution(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void cancelExecutionTest() { + ExecutionName name2 = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + String argument = "argument-1589682499"; + String result = "result-934426595"; + String workflowRevisionId = "workflowRevisionId-1453295745"; + Execution expectedResponse = + Execution.newBuilder() + .setName(name2.toString()) + .setArgument(argument) + .setResult(result) + .setWorkflowRevisionId(workflowRevisionId) + .build(); + mockExecutions.addResponse(expectedResponse); + + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + + Execution actualResponse = client.cancelExecution(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockExecutions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CancelExecutionRequest actualRequest = (CancelExecutionRequest) actualRequests.get(0); + + Assert.assertEquals(name, ExecutionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void cancelExecutionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockExecutions.addException(exception); + + try { + ExecutionName name = ExecutionName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]", "[EXECUTION]"); + + client.cancelExecution(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutions.java b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutions.java new file mode 100644 index 00000000..08f5ec97 --- /dev/null +++ b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutions.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.executions.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 MockExecutions implements MockGrpcService { + private final MockExecutionsImpl serviceImpl; + + public MockExecutions() { + serviceImpl = new MockExecutionsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutionsImpl.java b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutionsImpl.java new file mode 100644 index 00000000..c40d082d --- /dev/null +++ b/google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutionsImpl.java @@ -0,0 +1,118 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.v1beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.workflows.executions.v1beta.ExecutionsGrpc.ExecutionsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockExecutionsImpl extends ExecutionsImplBase { + private List requests; + private Queue responses; + + public MockExecutionsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listExecutions( + ListExecutionsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListExecutionsResponse) { + requests.add(request); + responseObserver.onNext((ListExecutionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createExecution( + CreateExecutionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Execution) { + requests.add(request); + responseObserver.onNext((Execution) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getExecution( + GetExecutionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Execution) { + requests.add(request); + responseObserver.onNext((Execution) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void cancelExecution( + CancelExecutionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Execution) { + requests.add(request); + responseObserver.onNext((Execution) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-workflow-executions-v1beta/pom.xml b/grpc-google-cloud-workflow-executions-v1beta/pom.xml new file mode 100644 index 00000000..5dbce9e5 --- /dev/null +++ b/grpc-google-cloud-workflow-executions-v1beta/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1beta + 0.0.1-SNAPSHOT + grpc-google-cloud-workflow-executions-v1beta + GRPC library for google-cloud-workflow-executions + + com.google.cloud + google-cloud-workflow-executions-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-workflow-executions-v1beta + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsGrpc.java b/grpc-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsGrpc.java new file mode 100644 index 00000000..5802eaf4 --- /dev/null +++ b/grpc-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsGrpc.java @@ -0,0 +1,739 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.workflows.executions.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; + +/** + * + * + *
+ * Executions is used to start and manage running instances of
+ * [Workflows][google.cloud.workflows.v1beta.Workflow] called executions.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/workflows/executions/v1beta/executions.proto") +public final class ExecutionsGrpc { + + private ExecutionsGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.workflows.executions.v1beta.Executions"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse> + getListExecutionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListExecutions", + requestType = com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest.class, + responseType = com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse> + getListExecutionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse> + getListExecutionsMethod; + if ((getListExecutionsMethod = ExecutionsGrpc.getListExecutionsMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getListExecutionsMethod = ExecutionsGrpc.getListExecutionsMethod) == null) { + ExecutionsGrpc.getListExecutionsMethod = + getListExecutionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListExecutions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ExecutionsMethodDescriptorSupplier("ListExecutions")) + .build(); + } + } + } + return getListExecutionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getCreateExecutionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateExecution", + requestType = com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest.class, + responseType = com.google.cloud.workflows.executions.v1beta.Execution.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getCreateExecutionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getCreateExecutionMethod; + if ((getCreateExecutionMethod = ExecutionsGrpc.getCreateExecutionMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getCreateExecutionMethod = ExecutionsGrpc.getCreateExecutionMethod) == null) { + ExecutionsGrpc.getCreateExecutionMethod = + getCreateExecutionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateExecution")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.Execution + .getDefaultInstance())) + .setSchemaDescriptor( + new ExecutionsMethodDescriptorSupplier("CreateExecution")) + .build(); + } + } + } + return getCreateExecutionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getGetExecutionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetExecution", + requestType = com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.class, + responseType = com.google.cloud.workflows.executions.v1beta.Execution.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getGetExecutionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getGetExecutionMethod; + if ((getGetExecutionMethod = ExecutionsGrpc.getGetExecutionMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getGetExecutionMethod = ExecutionsGrpc.getGetExecutionMethod) == null) { + ExecutionsGrpc.getGetExecutionMethod = + getGetExecutionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetExecution")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.Execution + .getDefaultInstance())) + .setSchemaDescriptor(new ExecutionsMethodDescriptorSupplier("GetExecution")) + .build(); + } + } + } + return getGetExecutionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getCancelExecutionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CancelExecution", + requestType = com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest.class, + responseType = com.google.cloud.workflows.executions.v1beta.Execution.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getCancelExecutionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution> + getCancelExecutionMethod; + if ((getCancelExecutionMethod = ExecutionsGrpc.getCancelExecutionMethod) == null) { + synchronized (ExecutionsGrpc.class) { + if ((getCancelExecutionMethod = ExecutionsGrpc.getCancelExecutionMethod) == null) { + ExecutionsGrpc.getCancelExecutionMethod = + getCancelExecutionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CancelExecution")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.workflows.executions.v1beta.Execution + .getDefaultInstance())) + .setSchemaDescriptor( + new ExecutionsMethodDescriptorSupplier("CancelExecution")) + .build(); + } + } + } + return getCancelExecutionMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ExecutionsStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ExecutionsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsStub(channel, callOptions); + } + }; + return ExecutionsStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ExecutionsBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ExecutionsBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsBlockingStub(channel, callOptions); + } + }; + return ExecutionsBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ExecutionsFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ExecutionsFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsFutureStub(channel, callOptions); + } + }; + return ExecutionsFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1beta.Workflow] called executions.
+   * 
+ */ + public abstract static class ExecutionsImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public void listExecutions( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListExecutionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public void createExecution( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateExecutionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public void getExecution( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetExecutionMethod(), responseObserver); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public void cancelExecution( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCancelExecutionMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListExecutionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest, + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse>( + this, METHODID_LIST_EXECUTIONS))) + .addMethod( + getCreateExecutionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution>( + this, METHODID_CREATE_EXECUTION))) + .addMethod( + getGetExecutionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution>( + this, METHODID_GET_EXECUTION))) + .addMethod( + getCancelExecutionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest, + com.google.cloud.workflows.executions.v1beta.Execution>( + this, METHODID_CANCEL_EXECUTION))) + .build(); + } + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1beta.Workflow] called executions.
+   * 
+ */ + public static final class ExecutionsStub extends io.grpc.stub.AbstractAsyncStub { + private ExecutionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ExecutionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public void listExecutions( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListExecutionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public void createExecution( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateExecutionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public void getExecution( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetExecutionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public void cancelExecution( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCancelExecutionMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1beta.Workflow] called executions.
+   * 
+ */ + public static final class ExecutionsBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ExecutionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ExecutionsBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse listExecutions( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest request) { + return blockingUnaryCall(getChannel(), getListExecutionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public com.google.cloud.workflows.executions.v1beta.Execution createExecution( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest request) { + return blockingUnaryCall(getChannel(), getCreateExecutionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public com.google.cloud.workflows.executions.v1beta.Execution getExecution( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest request) { + return blockingUnaryCall(getChannel(), getGetExecutionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public com.google.cloud.workflows.executions.v1beta.Execution cancelExecution( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest request) { + return blockingUnaryCall(getChannel(), getCancelExecutionMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Executions is used to start and manage running instances of
+   * [Workflows][google.cloud.workflows.v1beta.Workflow] called executions.
+   * 
+ */ + public static final class ExecutionsFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ExecutionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ExecutionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ExecutionsFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of executions which belong to the workflow with
+     * the given name. The method returns executions of all workflow
+     * revisions. Returned executions are ordered by their start time (newest
+     * first).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse> + listExecutions(com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListExecutionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new execution using the latest revision of the given workflow.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1beta.Execution> + createExecution( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateExecutionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns an execution of the given name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1beta.Execution> + getExecution(com.google.cloud.workflows.executions.v1beta.GetExecutionRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetExecutionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Cancels an execution of the given name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.workflows.executions.v1beta.Execution> + cancelExecution( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCancelExecutionMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_EXECUTIONS = 0; + private static final int METHODID_CREATE_EXECUTION = 1; + private static final int METHODID_GET_EXECUTION = 2; + private static final int METHODID_CANCEL_EXECUTION = 3; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ExecutionsImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ExecutionsImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_EXECUTIONS: + serviceImpl.listExecutions( + (com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse>) + responseObserver); + break; + case METHODID_CREATE_EXECUTION: + serviceImpl.createExecution( + (com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_EXECUTION: + serviceImpl.getExecution( + (com.google.cloud.workflows.executions.v1beta.GetExecutionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CANCEL_EXECUTION: + serviceImpl.cancelExecution( + (com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ExecutionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ExecutionsBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Executions"); + } + } + + private static final class ExecutionsFileDescriptorSupplier + extends ExecutionsBaseDescriptorSupplier { + ExecutionsFileDescriptorSupplier() {} + } + + private static final class ExecutionsMethodDescriptorSupplier + extends ExecutionsBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ExecutionsMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ExecutionsGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ExecutionsFileDescriptorSupplier()) + .addMethod(getListExecutionsMethod()) + .addMethod(getCreateExecutionMethod()) + .addMethod(getGetExecutionMethod()) + .addMethod(getCancelExecutionMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/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..85883fc1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,189 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflow-executions-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Workflow Executions Parent + https://github.com/googleapis/java- + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.9.4 + + + + + 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-workflow-executions-parent + + + + + + com.google.cloud + google-cloud-workflow-executions + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-workflow-executions-v1beta + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-workflow-executions-v1beta + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.13.0 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.objenesis:objenesis + javax.annotation:javax.annotation-api + + + + + + + + + google-cloud-workflow-executions + proto-google-cloud-workflow-executions-v1beta + grpc-google-cloud-workflow-executions-v1beta + google-cloud-workflow-executions-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-workflow-executions-v1beta/pom.xml b/proto-google-cloud-workflow-executions-v1beta/pom.xml new file mode 100644 index 00000000..cb861bf1 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-workflow-executions-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-workflow-executions-v1beta + Proto library for google-cloud-workflow-executions + + com.google.cloud + google-cloud-workflow-executions-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-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequest.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequest.java new file mode 100644 index 00000000..8b7b9b88 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequest.java @@ -0,0 +1,680 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +/** + * + * + *
+ * Request for the
+ * [CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.CancelExecutionRequest} + */ +public final class CancelExecutionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + CancelExecutionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CancelExecutionRequest.newBuilder() to construct. + private CancelExecutionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CancelExecutionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CancelExecutionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CancelExecutionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest.class, + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest other = + (com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.CancelExecutionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest.class, + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest build() { + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest buildPartial() { + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest result = + new com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) { + return mergeFrom( + (com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest other) { + if (other + == com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be cancelled.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + private static final com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest(); + } + + public static com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CancelExecutionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CancelExecutionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CancelExecutionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequestOrBuilder.java new file mode 100644 index 00000000..195f1950 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public interface CancelExecutionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.CancelExecutionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the execution to be cancelled.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequest.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequest.java new file mode 100644 index 00000000..8db2e7a3 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequest.java @@ -0,0 +1,983 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +/** + * + * + *
+ * Request for the
+ * [CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.CreateExecutionRequest} + */ +public final class CreateExecutionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + CreateExecutionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateExecutionRequest.newBuilder() to construct. + private CreateExecutionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateExecutionRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateExecutionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateExecutionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.workflows.executions.v1beta.Execution.Builder subBuilder = null; + if (execution_ != null) { + subBuilder = execution_.toBuilder(); + } + execution_ = + input.readMessage( + com.google.cloud.workflows.executions.v1beta.Execution.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(execution_); + execution_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest.class, + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXECUTION_FIELD_NUMBER = 2; + private com.google.cloud.workflows.executions.v1beta.Execution execution_; + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the execution field is set. + */ + @java.lang.Override + public boolean hasExecution() { + return execution_ != null; + } + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The execution. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution getExecution() { + return execution_ == null + ? com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance() + : execution_; + } + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder getExecutionOrBuilder() { + return getExecution(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (execution_ != null) { + output.writeMessage(2, getExecution()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (execution_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExecution()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest other = + (com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasExecution() != other.hasExecution()) return false; + if (hasExecution()) { + if (!getExecution().equals(other.getExecution())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasExecution()) { + hash = (37 * hash) + EXECUTION_FIELD_NUMBER; + hash = (53 * hash) + getExecution().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.CreateExecutionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest.class, + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (executionBuilder_ == null) { + execution_ = null; + } else { + execution_ = null; + executionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest build() { + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest buildPartial() { + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest result = + new com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest(this); + result.parent_ = parent_; + if (executionBuilder_ == null) { + result.execution_ = execution_; + } else { + result.execution_ = executionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) { + return mergeFrom( + (com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest other) { + if (other + == com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasExecution()) { + mergeExecution(other.getExecution()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which an execution should be created.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * The latest revision of the workflow will be used.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.workflows.executions.v1beta.Execution execution_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution, + com.google.cloud.workflows.executions.v1beta.Execution.Builder, + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder> + executionBuilder_; + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the execution field is set. + */ + public boolean hasExecution() { + return executionBuilder_ != null || execution_ != null; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The execution. + */ + public com.google.cloud.workflows.executions.v1beta.Execution getExecution() { + if (executionBuilder_ == null) { + return execution_ == null + ? com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance() + : execution_; + } else { + return executionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExecution(com.google.cloud.workflows.executions.v1beta.Execution value) { + if (executionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + execution_ = value; + onChanged(); + } else { + executionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExecution( + com.google.cloud.workflows.executions.v1beta.Execution.Builder builderForValue) { + if (executionBuilder_ == null) { + execution_ = builderForValue.build(); + onChanged(); + } else { + executionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExecution(com.google.cloud.workflows.executions.v1beta.Execution value) { + if (executionBuilder_ == null) { + if (execution_ != null) { + execution_ = + com.google.cloud.workflows.executions.v1beta.Execution.newBuilder(execution_) + .mergeFrom(value) + .buildPartial(); + } else { + execution_ = value; + } + onChanged(); + } else { + executionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExecution() { + if (executionBuilder_ == null) { + execution_ = null; + onChanged(); + } else { + execution_ = null; + executionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.executions.v1beta.Execution.Builder getExecutionBuilder() { + + onChanged(); + return getExecutionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder getExecutionOrBuilder() { + if (executionBuilder_ != null) { + return executionBuilder_.getMessageOrBuilder(); + } else { + return execution_ == null + ? com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance() + : execution_; + } + } + /** + * + * + *
+     * Required. Execution to be created.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution, + com.google.cloud.workflows.executions.v1beta.Execution.Builder, + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder> + getExecutionFieldBuilder() { + if (executionBuilder_ == null) { + executionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution, + com.google.cloud.workflows.executions.v1beta.Execution.Builder, + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder>( + getExecution(), getParentForChildren(), isClean()); + execution_ = null; + } + return executionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + private static final com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest(); + } + + public static com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateExecutionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateExecutionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.CreateExecutionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequestOrBuilder.java new file mode 100644 index 00000000..7b68f64e --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public interface CreateExecutionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.CreateExecutionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the workflow for which an execution should be created.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * The latest revision of the workflow will be used.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the execution field is set. + */ + boolean hasExecution(); + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The execution. + */ + com.google.cloud.workflows.executions.v1beta.Execution getExecution(); + /** + * + * + *
+   * Required. Execution to be created.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution execution = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder getExecutionOrBuilder(); +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/Execution.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/Execution.java new file mode 100644 index 00000000..5c086aa0 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/Execution.java @@ -0,0 +1,3330 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +/** + * + * + *
+ * A running instance of a [Workflow][google.cloud.workflows.v1beta.Workflow].
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.Execution} + */ +public final class Execution extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.Execution) + ExecutionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Execution.newBuilder() to construct. + private Execution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Execution() { + name_ = ""; + state_ = 0; + argument_ = ""; + result_ = ""; + workflowRevisionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Execution(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Execution( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + argument_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + result_ = s; + break; + } + case 58: + { + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder subBuilder = + null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.cloud.workflows.executions.v1beta.Execution.Error.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + workflowRevisionId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.Execution.class, + com.google.cloud.workflows.executions.v1beta.Execution.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of the execution. More states may be added
+   * in the future.
+   * 
+ * + * Protobuf enum {@code google.cloud.workflows.executions.v1beta.Execution.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The execution is in progress.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * The execution finished successfully.
+     * 
+ * + * SUCCEEDED = 2; + */ + SUCCEEDED(2), + /** + * + * + *
+     * The execution failed with an error.
+     * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + * + * + *
+     * The execution was stopped intentionally.
+     * 
+ * + * CANCELLED = 4; + */ + CANCELLED(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The execution is in progress.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * The execution finished successfully.
+     * 
+ * + * SUCCEEDED = 2; + */ + public static final int SUCCEEDED_VALUE = 2; + /** + * + * + *
+     * The execution failed with an error.
+     * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + * + * + *
+     * The execution was stopped intentionally.
+     * 
+ * + * CANCELLED = 4; + */ + public static final int CANCELLED_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return SUCCEEDED; + case 3: + return FAILED; + case 4: + return CANCELLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.Execution.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.workflows.executions.v1beta.Execution.State) + } + + public interface ErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.Execution.Error) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The payload. + */ + java.lang.String getPayload(); + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The bytes for payload. + */ + com.google.protobuf.ByteString getPayloadBytes(); + + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The context. + */ + java.lang.String getContext(); + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + com.google.protobuf.ByteString getContextBytes(); + } + /** + * + * + *
+   * Error describes why the execution was abnormally terminated.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.Execution.Error} + */ + public static final class Error extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.Execution.Error) + ErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use Error.newBuilder() to construct. + private Error(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Error() { + payload_ = ""; + context_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Error(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Error( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + payload_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + context_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.Execution.Error.class, + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private volatile java.lang.Object payload_; + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The payload. + */ + @java.lang.Override + public java.lang.String getPayload() { + java.lang.Object ref = payload_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payload_ = s; + return s; + } + } + /** + * + * + *
+     * Error payload returned by the execution, represented as a JSON string.
+     * 
+ * + * string payload = 1; + * + * @return The bytes for payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayloadBytes() { + java.lang.Object ref = payload_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object context_; + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The context. + */ + @java.lang.Override + public java.lang.String getContext() { + java.lang.Object ref = context_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + context_ = s; + return s; + } + } + /** + * + * + *
+     * Human readable error context, helpful for debugging purposes.
+     * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContextBytes() { + java.lang.Object ref = context_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + context_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getPayloadBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, payload_); + } + if (!getContextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, context_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPayloadBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, payload_); + } + if (!getContextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, context_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.Execution.Error)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.Execution.Error other = + (com.google.cloud.workflows.executions.v1beta.Execution.Error) obj; + + if (!getPayload().equals(other.getPayload())) return false; + if (!getContext().equals(other.getContext())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.Execution.Error prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Error describes why the execution was abnormally terminated.
+     * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.Execution.Error} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.Execution.Error) + com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.Execution.Error.class, + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1beta.Execution.Error.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + payload_ = ""; + + context_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.Error + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.Execution.Error.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.Error build() { + com.google.cloud.workflows.executions.v1beta.Execution.Error result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.Error buildPartial() { + com.google.cloud.workflows.executions.v1beta.Execution.Error result = + new com.google.cloud.workflows.executions.v1beta.Execution.Error(this); + result.payload_ = payload_; + result.context_ = context_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.Execution.Error) { + return mergeFrom((com.google.cloud.workflows.executions.v1beta.Execution.Error) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.executions.v1beta.Execution.Error other) { + if (other + == com.google.cloud.workflows.executions.v1beta.Execution.Error.getDefaultInstance()) + return this; + if (!other.getPayload().isEmpty()) { + payload_ = other.payload_; + onChanged(); + } + if (!other.getContext().isEmpty()) { + context_ = other.context_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.Execution.Error parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.Execution.Error) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object payload_ = ""; + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @return The payload. + */ + public java.lang.String getPayload() { + java.lang.Object ref = payload_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + payload_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @return The bytes for payload. + */ + public com.google.protobuf.ByteString getPayloadBytes() { + java.lang.Object ref = payload_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + payload_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + payload_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + /** + * + * + *
+       * Error payload returned by the execution, represented as a JSON string.
+       * 
+ * + * string payload = 1; + * + * @param value The bytes for payload to set. + * @return This builder for chaining. + */ + public Builder setPayloadBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + payload_ = value; + onChanged(); + return this; + } + + private java.lang.Object context_ = ""; + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @return The context. + */ + public java.lang.String getContext() { + java.lang.Object ref = context_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + context_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @return The bytes for context. + */ + public com.google.protobuf.ByteString getContextBytes() { + java.lang.Object ref = context_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + context_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @param value The context to set. + * @return This builder for chaining. + */ + public Builder setContext(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + context_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @return This builder for chaining. + */ + public Builder clearContext() { + + context_ = getDefaultInstance().getContext(); + onChanged(); + return this; + } + /** + * + * + *
+       * Human readable error context, helpful for debugging purposes.
+       * 
+ * + * string context = 2; + * + * @param value The bytes for context to set. + * @return This builder for chaining. + */ + public Builder setContextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + context_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.Execution.Error) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.Execution.Error) + private static final com.google.cloud.workflows.executions.v1beta.Execution.Error + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.Execution.Error(); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution.Error + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Error parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Error(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.Error + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int STATE_FIELD_NUMBER = 4; + private int state_; + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1beta.Execution.State result = + com.google.cloud.workflows.executions.v1beta.Execution.State.valueOf(state_); + return result == null + ? com.google.cloud.workflows.executions.v1beta.Execution.State.UNRECOGNIZED + : result; + } + + public static final int ARGUMENT_FIELD_NUMBER = 5; + private volatile java.lang.Object argument_; + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The argument. + */ + @java.lang.Override + public java.lang.String getArgument() { + java.lang.Object ref = argument_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + argument_ = s; + return s; + } + } + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The bytes for argument. + */ + @java.lang.Override + public com.google.protobuf.ByteString getArgumentBytes() { + java.lang.Object ref = argument_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + argument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESULT_FIELD_NUMBER = 6; + private volatile java.lang.Object result_; + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The result. + */ + @java.lang.Override + public java.lang.String getResult() { + java.lang.Object ref = result_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + result_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for result. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResultBytes() { + java.lang.Object ref = result_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + result_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 7; + private com.google.cloud.workflows.executions.v1beta.Execution.Error error_; + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.Error getError() { + return error_ == null + ? com.google.cloud.workflows.executions.v1beta.Execution.Error.getDefaultInstance() + : error_; + } + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder getErrorOrBuilder() { + return getError(); + } + + public static final int WORKFLOW_REVISION_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object workflowRevisionId_; + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workflowRevisionId. + */ + @java.lang.Override + public java.lang.String getWorkflowRevisionId() { + java.lang.Object ref = workflowRevisionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workflowRevisionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workflowRevisionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkflowRevisionIdBytes() { + java.lang.Object ref = workflowRevisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workflowRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (startTime_ != null) { + output.writeMessage(2, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(3, getEndTime()); + } + if (state_ + != com.google.cloud.workflows.executions.v1beta.Execution.State.STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, state_); + } + if (!getArgumentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, argument_); + } + if (!getResultBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, result_); + } + if (error_ != null) { + output.writeMessage(7, getError()); + } + if (!getWorkflowRevisionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, workflowRevisionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); + } + if (state_ + != com.google.cloud.workflows.executions.v1beta.Execution.State.STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!getArgumentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, argument_); + } + if (!getResultBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, result_); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getError()); + } + if (!getWorkflowRevisionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, workflowRevisionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.Execution)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.Execution other = + (com.google.cloud.workflows.executions.v1beta.Execution) obj; + + if (!getName().equals(other.getName())) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (state_ != other.state_) return false; + if (!getArgument().equals(other.getArgument())) return false; + if (!getResult().equals(other.getResult())) return false; + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError().equals(other.getError())) return false; + } + if (!getWorkflowRevisionId().equals(other.getWorkflowRevisionId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + ARGUMENT_FIELD_NUMBER; + hash = (53 * hash) + getArgument().hashCode(); + hash = (37 * hash) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + getResult().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (37 * hash) + WORKFLOW_REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getWorkflowRevisionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.Execution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A running instance of a [Workflow][google.cloud.workflows.v1beta.Workflow].
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.Execution} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.Execution) + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.Execution.class, + com.google.cloud.workflows.executions.v1beta.Execution.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1beta.Execution.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + state_ = 0; + + argument_ = ""; + + result_ = ""; + + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + workflowRevisionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_Execution_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution build() { + com.google.cloud.workflows.executions.v1beta.Execution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution buildPartial() { + com.google.cloud.workflows.executions.v1beta.Execution result = + new com.google.cloud.workflows.executions.v1beta.Execution(this); + result.name_ = name_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.state_ = state_; + result.argument_ = argument_; + result.result_ = result_; + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + result.workflowRevisionId_ = workflowRevisionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.Execution) { + return mergeFrom((com.google.cloud.workflows.executions.v1beta.Execution) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.workflows.executions.v1beta.Execution other) { + if (other == com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getArgument().isEmpty()) { + argument_ = other.argument_; + onChanged(); + } + if (!other.getResult().isEmpty()) { + result_ = other.result_; + onChanged(); + } + if (other.hasError()) { + mergeError(other.getError()); + } + if (!other.getWorkflowRevisionId().isEmpty()) { + workflowRevisionId_ = other.workflowRevisionId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.Execution parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.Execution) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the execution.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. Marks the beginning of execution.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. Marks the end of execution, successful or not.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1beta.Execution.State result = + com.google.cloud.workflows.executions.v1beta.Execution.State.valueOf(state_); + return result == null + ? com.google.cloud.workflows.executions.v1beta.Execution.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.workflows.executions.v1beta.Execution.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the execution.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object argument_ = ""; + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @return The argument. + */ + public java.lang.String getArgument() { + java.lang.Object ref = argument_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + argument_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @return The bytes for argument. + */ + public com.google.protobuf.ByteString getArgumentBytes() { + java.lang.Object ref = argument_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + argument_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @param value The argument to set. + * @return This builder for chaining. + */ + public Builder setArgument(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + argument_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @return This builder for chaining. + */ + public Builder clearArgument() { + + argument_ = getDefaultInstance().getArgument(); + onChanged(); + return this; + } + /** + * + * + *
+     * Input parameters of the execution represented as a JSON string.
+     * The size limit is 32KB.
+     * 
+ * + * string argument = 5; + * + * @param value The bytes for argument to set. + * @return This builder for chaining. + */ + public Builder setArgumentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + argument_ = value; + onChanged(); + return this; + } + + private java.lang.Object result_ = ""; + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The result. + */ + public java.lang.String getResult() { + java.lang.Object ref = result_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + result_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for result. + */ + public com.google.protobuf.ByteString getResultBytes() { + java.lang.Object ref = result_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + result_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + result_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearResult() { + + result_ = getDefaultInstance().getResult(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Output of the execution represented as a JSON string. The
+     * value can only be present if the execution's state is `SUCCEEDED`.
+     * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for result to set. + * @return This builder for chaining. + */ + public Builder setResultBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + result_ = value; + onChanged(); + return this; + } + + private com.google.cloud.workflows.executions.v1beta.Execution.Error error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution.Error, + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder, + com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder> + errorBuilder_; + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + public com.google.cloud.workflows.executions.v1beta.Execution.Error getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.cloud.workflows.executions.v1beta.Execution.Error.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError(com.google.cloud.workflows.executions.v1beta.Execution.Error value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setError( + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeError(com.google.cloud.workflows.executions.v1beta.Execution.Error value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.cloud.workflows.executions.v1beta.Execution.Error.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder + getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.cloud.workflows.executions.v1beta.Execution.Error.getDefaultInstance() + : error_; + } + } + /** + * + * + *
+     * Output only. The error which caused the execution to finish prematurely.
+     * The value is only present if the execution's state is `FAILED`
+     * or `CANCELLED`.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution.Error, + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder, + com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution.Error, + com.google.cloud.workflows.executions.v1beta.Execution.Error.Builder, + com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder>( + getError(), getParentForChildren(), isClean()); + error_ = null; + } + return errorBuilder_; + } + + private java.lang.Object workflowRevisionId_ = ""; + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workflowRevisionId. + */ + public java.lang.String getWorkflowRevisionId() { + java.lang.Object ref = workflowRevisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workflowRevisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workflowRevisionId. + */ + public com.google.protobuf.ByteString getWorkflowRevisionIdBytes() { + java.lang.Object ref = workflowRevisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workflowRevisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The workflowRevisionId to set. + * @return This builder for chaining. + */ + public Builder setWorkflowRevisionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workflowRevisionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearWorkflowRevisionId() { + + workflowRevisionId_ = getDefaultInstance().getWorkflowRevisionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Revision of the workflow this execution is using.
+     * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for workflowRevisionId to set. + * @return This builder for chaining. + */ + public Builder setWorkflowRevisionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workflowRevisionId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.Execution) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.Execution) + private static final com.google.cloud.workflows.executions.v1beta.Execution DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.Execution(); + } + + public static com.google.cloud.workflows.executions.v1beta.Execution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Execution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Execution(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionName.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionName.java new file mode 100644 index 00000000..70ecfad0 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionName.java @@ -0,0 +1,243 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.workflows.executions.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 ExecutionName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String workflow; + private final String execution; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkflow() { + return workflow; + } + + public String getExecution() { + return execution; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ExecutionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workflow = Preconditions.checkNotNull(builder.getWorkflow()); + execution = Preconditions.checkNotNull(builder.getExecution()); + } + + public static ExecutionName of( + String project, String location, String workflow, String execution) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkflow(workflow) + .setExecution(execution) + .build(); + } + + public static String format(String project, String location, String workflow, String execution) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setWorkflow(workflow) + .setExecution(execution) + .build() + .toString(); + } + + public static ExecutionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ExecutionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("workflow"), + matchMap.get("execution")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ExecutionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return 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); + fieldMapBuilder.put("execution", execution); + 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, "execution", execution); + } + + /** Builder for ExecutionName. */ + public static class Builder { + + private String project; + private String location; + private String workflow; + private String execution; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getWorkflow() { + return workflow; + } + + public String getExecution() { + return execution; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setWorkflow(String workflow) { + this.workflow = workflow; + return this; + } + + public Builder setExecution(String execution) { + this.execution = execution; + return this; + } + + private Builder() {} + + private Builder(ExecutionName executionName) { + project = executionName.project; + location = executionName.location; + workflow = executionName.workflow; + execution = executionName.execution; + } + + public ExecutionName build() { + return new ExecutionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ExecutionName) { + ExecutionName that = (ExecutionName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.workflow.equals(that.workflow)) + && (this.execution.equals(that.execution)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= workflow.hashCode(); + h *= 1000003; + h ^= execution.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionOrBuilder.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionOrBuilder.java new file mode 100644 index 00000000..e936b9a7 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionOrBuilder.java @@ -0,0 +1,285 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public interface ExecutionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.Execution) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the execution.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. Marks the beginning of execution.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. Marks the end of execution, successful or not.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of the execution.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.workflows.executions.v1beta.Execution.State getState(); + + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The argument. + */ + java.lang.String getArgument(); + /** + * + * + *
+   * Input parameters of the execution represented as a JSON string.
+   * The size limit is 32KB.
+   * 
+ * + * string argument = 5; + * + * @return The bytes for argument. + */ + com.google.protobuf.ByteString getArgumentBytes(); + + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The result. + */ + java.lang.String getResult(); + /** + * + * + *
+   * Output only. Output of the execution represented as a JSON string. The
+   * value can only be present if the execution's state is `SUCCEEDED`.
+   * 
+ * + * string result = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for result. + */ + com.google.protobuf.ByteString getResultBytes(); + + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the error field is set. + */ + boolean hasError(); + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The error. + */ + com.google.cloud.workflows.executions.v1beta.Execution.Error getError(); + /** + * + * + *
+   * Output only. The error which caused the execution to finish prematurely.
+   * The value is only present if the execution's state is `FAILED`
+   * or `CANCELLED`.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.Execution.Error error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.workflows.executions.v1beta.Execution.ErrorOrBuilder getErrorOrBuilder(); + + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The workflowRevisionId. + */ + java.lang.String getWorkflowRevisionId(); + /** + * + * + *
+   * Output only. Revision of the workflow this execution is using.
+   * 
+ * + * string workflow_revision_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for workflowRevisionId. + */ + com.google.protobuf.ByteString getWorkflowRevisionIdBytes(); +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionView.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionView.java new file mode 100644 index 00000000..74af5f69 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionView.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +/** + * + * + *
+ * Defines possible views for execution resource.
+ * 
+ * + * Protobuf enum {@code google.cloud.workflows.executions.v1beta.ExecutionView} + */ +public enum ExecutionView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default / unset value.
+   * 
+ * + * EXECUTION_VIEW_UNSPECIFIED = 0; + */ + EXECUTION_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Includes only basic metadata about the execution.
+   * Following fields are returned: name, start_time, end_time, state
+   * and workflow_revision_id.
+   * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + * + * + *
+   * Includes all data.
+   * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default / unset value.
+   * 
+ * + * EXECUTION_VIEW_UNSPECIFIED = 0; + */ + public static final int EXECUTION_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Includes only basic metadata about the execution.
+   * Following fields are returned: name, start_time, end_time, state
+   * and workflow_revision_id.
+   * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + /** + * + * + *
+   * Includes all data.
+   * 
+ * + * FULL = 2; + */ + public static final int FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExecutionView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ExecutionView forNumber(int value) { + switch (value) { + case 0: + return EXECUTION_VIEW_UNSPECIFIED; + case 1: + return BASIC; + case 2: + return FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExecutionView findValueByNumber(int number) { + return ExecutionView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ExecutionView[] VALUES = values(); + + public static ExecutionView valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ExecutionView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.workflows.executions.v1beta.ExecutionView) +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsProto.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsProto.java new file mode 100644 index 00000000..53b978e9 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsProto.java @@ -0,0 +1,238 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public final class ExecutionsProto { + private ExecutionsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_Execution_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_Execution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_Execution_Error_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_CreateExecutionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_workflows_executions_v1beta_CancelExecutionRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n9google/cloud/workflows/executions/v1be" + + "ta/executions.proto\022(google.cloud.workfl" + + "ows.executions.v1beta\032\034google/api/annota" + + "tions.proto\032\027google/api/client.proto\032\037go" + + "ogle/api/field_behavior.proto\032\031google/ap" + + "i/resource.proto\032\037google/protobuf/timest" + + "amp.proto\"\370\004\n\tExecution\022\021\n\004name\030\001 \001(\tB\003\340" + + "A\003\0223\n\nstart_time\030\002 \001(\0132\032.google.protobuf" + + ".TimestampB\003\340A\003\0221\n\010end_time\030\003 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\022M\n\005state\030\004 \001(" + + "\01629.google.cloud.workflows.executions.v1" + + "beta.Execution.StateB\003\340A\003\022\020\n\010argument\030\005 " + + "\001(\t\022\023\n\006result\030\006 \001(\tB\003\340A\003\022M\n\005error\030\007 \001(\0132" + + "9.google.cloud.workflows.executions.v1be" + + "ta.Execution.ErrorB\003\340A\003\022!\n\024workflow_revi" + + "sion_id\030\010 \001(\tB\003\340A\003\032)\n\005Error\022\017\n\007payload\030\001" + + " \001(\t\022\017\n\007context\030\002 \001(\t\"T\n\005State\022\025\n\021STATE_" + + "UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\r\n\tSUCCEEDED\020\002" + + "\022\n\n\006FAILED\020\003\022\r\n\tCANCELLED\020\004:\206\001\352A\202\001\n+work" + + "flowexecutions.googleapis.com/Execution\022" + + "Sprojects/{project}/locations/{location}" + + "/workflows/{workflow}/executions/{execut" + + "ion}\"\305\001\n\025ListExecutionsRequest\0229\n\006parent" + + "\030\001 \001(\tB)\340A\002\372A#\n!workflows.googleapis.com" + + "/Workflow\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_tok" + + "en\030\003 \001(\t\022J\n\004view\030\004 \001(\01627.google.cloud.wo" + + "rkflows.executions.v1beta.ExecutionViewB" + + "\003\340A\001\"z\n\026ListExecutionsResponse\022G\n\nexecut" + + "ions\030\001 \003(\01323.google.cloud.workflows.exec" + + "utions.v1beta.Execution\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"\240\001\n\026CreateExecutionRequest\0229\n\006p" + + "arent\030\001 \001(\tB)\340A\002\372A#\n!workflows.googleapi" + + "s.com/Workflow\022K\n\texecution\030\002 \001(\01323.goog" + + "le.cloud.workflows.executions.v1beta.Exe" + + "cutionB\003\340A\002\"\244\001\n\023GetExecutionRequest\022A\n\004n" + + "ame\030\001 \001(\tB3\340A\002\372A-\n+workflowexecutions.go" + + "ogleapis.com/Execution\022J\n\004view\030\002 \001(\01627.g" + + "oogle.cloud.workflows.executions.v1beta." + + "ExecutionViewB\003\340A\001\"[\n\026CancelExecutionReq" + + "uest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+workflowexec" + + "utions.googleapis.com/Execution*D\n\rExecu" + + "tionView\022\036\n\032EXECUTION_VIEW_UNSPECIFIED\020\000" + + "\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\0022\363\007\n\nExecutions\022\344\001\n" + + "\016ListExecutions\022?.google.cloud.workflows" + + ".executions.v1beta.ListExecutionsRequest" + + "\032@.google.cloud.workflows.executions.v1b" + + "eta.ListExecutionsResponse\"O\202\323\344\223\002@\022>/v1b" + + "eta/{parent=projects/*/locations/*/workf" + + "lows/*}/executions\332A\006parent\022\356\001\n\017CreateEx" + + "ecution\022@.google.cloud.workflows.executi" + + "ons.v1beta.CreateExecutionRequest\0323.goog" + + "le.cloud.workflows.executions.v1beta.Exe" + + "cution\"d\202\323\344\223\002K\">/v1beta/{parent=projects" + + "/*/locations/*/workflows/*}/executions:\t" + + "execution\332A\020parent,execution\022\321\001\n\014GetExec" + + "ution\022=.google.cloud.workflows.execution" + + "s.v1beta.GetExecutionRequest\0323.google.cl" + + "oud.workflows.executions.v1beta.Executio" + + "n\"M\202\323\344\223\002@\022>/v1beta/{name=projects/*/loca" + + "tions/*/workflows/*/executions/*}\332A\004name" + + "\022\341\001\n\017CancelExecution\022@.google.cloud.work" + + "flows.executions.v1beta.CancelExecutionR" + + "equest\0323.google.cloud.workflows.executio" + + "ns.v1beta.Execution\"W\202\323\344\223\002J\"E/v1beta/{na" + + "me=projects/*/locations/*/workflows/*/ex" + + "ecutions/*}:cancel:\001*\332A\004name\032U\312A!workflo" + + "wexecutions.googleapis.com\322A.https://www" + + ".googleapis.com/auth/cloud-platformB\371\001\n," + + "com.google.cloud.workflows.executions.v1" + + "betaB\017ExecutionsProtoP\001ZRgoogle.golang.o" + + "rg/genproto/googleapis/cloud/workflows/e" + + "xecutions/v1beta;executions\352Aa\n!workflow" + + "s.googleapis.com/Workflow\022 + * Request for the + * [GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution] + * method. + * + * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.GetExecutionRequest} + */ +public final class GetExecutionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.GetExecutionRequest) + GetExecutionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetExecutionRequest.newBuilder() to construct. + private GetExecutionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetExecutionRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetExecutionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetExecutionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.class, + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1beta.ExecutionView result = + com.google.cloud.workflows.executions.v1beta.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1beta.ExecutionView.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (view_ + != com.google.cloud.workflows.executions.v1beta.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (view_ + != com.google.cloud.workflows.executions.v1beta.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.GetExecutionRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest other = + (com.google.cloud.workflows.executions.v1beta.GetExecutionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.GetExecutionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.GetExecutionRequest) + com.google.cloud.workflows.executions.v1beta.GetExecutionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.class, + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.Builder.class); + } + + // Construct using com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_GetExecutionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.GetExecutionRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.GetExecutionRequest build() { + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.GetExecutionRequest buildPartial() { + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest result = + new com.google.cloud.workflows.executions.v1beta.GetExecutionRequest(this); + result.name_ = name_; + result.view_ = view_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.GetExecutionRequest) { + return mergeFrom((com.google.cloud.workflows.executions.v1beta.GetExecutionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest other) { + if (other + == com.google.cloud.workflows.executions.v1beta.GetExecutionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.GetExecutionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.GetExecutionRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the execution to be retrieved.
+     * Format:
+     * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1beta.ExecutionView result = + com.google.cloud.workflows.executions.v1beta.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1beta.ExecutionView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.workflows.executions.v1beta.ExecutionView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned execution.
+     * The API will default to the FULL view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.GetExecutionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.GetExecutionRequest) + private static final com.google.cloud.workflows.executions.v1beta.GetExecutionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.GetExecutionRequest(); + } + + public static com.google.cloud.workflows.executions.v1beta.GetExecutionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetExecutionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetExecutionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.GetExecutionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequestOrBuilder.java new file mode 100644 index 00000000..a1c7f5dd --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequestOrBuilder.java @@ -0,0 +1,89 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public interface GetExecutionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.GetExecutionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the execution to be retrieved.
+   * Format:
+   * projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned execution.
+   * The API will default to the FULL view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.workflows.executions.v1beta.ExecutionView getView(); +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequest.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequest.java new file mode 100644 index 00000000..e02f628c --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequest.java @@ -0,0 +1,1158 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +/** + * + * + *
+ * Request for the
+ * [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.ListExecutionsRequest} + */ +public final class ListExecutionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + ListExecutionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListExecutionsRequest.newBuilder() to construct. + private ListExecutionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExecutionsRequest() { + parent_ = ""; + pageToken_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExecutionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListExecutionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest.class, + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of executions to return per call.
+   * Max supported value depends on the selected Execution view: it's 10000 for
+   * BASIC and 100 for FULL. The default value used if the field is not
+   * specified is 100, regardless of the selected view. Values greater than
+   * the max value will be coerced down to it.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 4; + private int view_; + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1beta.ExecutionView result = + com.google.cloud.workflows.executions.v1beta.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1beta.ExecutionView.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (view_ + != com.google.cloud.workflows.executions.v1beta.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, view_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (view_ + != com.google.cloud.workflows.executions.v1beta.ExecutionView.EXECUTION_VIEW_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, view_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest other = + (com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (view_ != other.view_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the
+   * [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.ListExecutionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest.class, + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest build() { + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest buildPartial() { + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest result = + new com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.view_ = view_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) { + return mergeFrom( + (com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest other) { + if (other + == com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the workflow for which the executions should be listed.
+     * Format: projects/{project}/locations/{location}/workflows/{workflow}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of executions to return per call.
+     * Max supported value depends on the selected Execution view: it's 10000 for
+     * BASIC and 100 for FULL. The default value used if the field is not
+     * specified is 100, regardless of the selected view. Values greater than
+     * the max value will be coerced down to it.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of executions to return per call.
+     * Max supported value depends on the selected Execution view: it's 10000 for
+     * BASIC and 100 for FULL. The default value used if the field is not
+     * specified is 100, regardless of the selected view. Values greater than
+     * the max value will be coerced down to it.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of executions to return per call.
+     * Max supported value depends on the selected Execution view: it's 10000 for
+     * BASIC and 100 for FULL. The default value used if the field is not
+     * specified is 100, regardless of the selected view. Values greater than
+     * the max value will be coerced down to it.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token, received from a previous `ListExecutions` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListExecutions` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int view_ = 0; + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ExecutionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.workflows.executions.v1beta.ExecutionView result = + com.google.cloud.workflows.executions.v1beta.ExecutionView.valueOf(view_); + return result == null + ? com.google.cloud.workflows.executions.v1beta.ExecutionView.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.workflows.executions.v1beta.ExecutionView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A view defining which fields should be filled in the returned executions.
+     * The API will default to the BASIC view.
+     * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + private static final com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest(); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExecutionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListExecutionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequestOrBuilder.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequestOrBuilder.java new file mode 100644 index 00000000..bb32cb76 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequestOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public interface ListExecutionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.ListExecutionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the workflow for which the executions should be listed.
+   * Format: projects/{project}/locations/{location}/workflows/{workflow}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of executions to return per call.
+   * Max supported value depends on the selected Execution view: it's 10000 for
+   * BASIC and 100 for FULL. The default value used if the field is not
+   * specified is 100, regardless of the selected view. Values greater than
+   * the max value will be coerced down to it.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A page token, received from a previous `ListExecutions` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListExecutions` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Optional. A view defining which fields should be filled in the returned executions.
+   * The API will default to the BASIC view.
+   * 
+ * + * + * .google.cloud.workflows.executions.v1beta.ExecutionView view = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The view. + */ + com.google.cloud.workflows.executions.v1beta.ExecutionView getView(); +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponse.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponse.java new file mode 100644 index 00000000..4f1ea834 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponse.java @@ -0,0 +1,1167 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +/** + * + * + *
+ * Response for the
+ * [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.ListExecutionsResponse} + */ +public final class ListExecutionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + ListExecutionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListExecutionsResponse.newBuilder() to construct. + private ListExecutionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExecutionsResponse() { + executions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExecutionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListExecutionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + executions_ = + new java.util.ArrayList< + com.google.cloud.workflows.executions.v1beta.Execution>(); + mutable_bitField0_ |= 0x00000001; + } + executions_.add( + input.readMessage( + com.google.cloud.workflows.executions.v1beta.Execution.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + executions_ = java.util.Collections.unmodifiableList(executions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse.class, + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse.Builder.class); + } + + public static final int EXECUTIONS_FIELD_NUMBER = 1; + private java.util.List executions_; + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + @java.lang.Override + public java.util.List + getExecutionsList() { + return executions_; + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + @java.lang.Override + public java.util.List + getExecutionsOrBuilderList() { + return executions_; + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + @java.lang.Override + public int getExecutionsCount() { + return executions_.size(); + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.Execution getExecutions(int index) { + return executions_.get(index); + } + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder getExecutionsOrBuilder( + int index) { + return executions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < executions_.size(); i++) { + output.writeMessage(1, executions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < executions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, executions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse)) { + return super.equals(obj); + } + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse other = + (com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse) obj; + + if (!getExecutionsList().equals(other.getExecutionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExecutionsCount() > 0) { + hash = (37 * hash) + EXECUTIONS_FIELD_NUMBER; + hash = (53 * hash) + getExecutionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the
+   * [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.workflows.executions.v1beta.ListExecutionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse.class, + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExecutionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (executionsBuilder_ == null) { + executions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + executionsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.workflows.executions.v1beta.ExecutionsProto + .internal_static_google_cloud_workflows_executions_v1beta_ListExecutionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + getDefaultInstanceForType() { + return com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse build() { + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse buildPartial() { + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse result = + new com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse(this); + int from_bitField0_ = bitField0_; + if (executionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + executions_ = java.util.Collections.unmodifiableList(executions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.executions_ = executions_; + } else { + result.executions_ = executionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse) { + return mergeFrom( + (com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse other) { + if (other + == com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + .getDefaultInstance()) return this; + if (executionsBuilder_ == null) { + if (!other.executions_.isEmpty()) { + if (executions_.isEmpty()) { + executions_ = other.executions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExecutionsIsMutable(); + executions_.addAll(other.executions_); + } + onChanged(); + } + } else { + if (!other.executions_.isEmpty()) { + if (executionsBuilder_.isEmpty()) { + executionsBuilder_.dispose(); + executionsBuilder_ = null; + executions_ = other.executions_; + bitField0_ = (bitField0_ & ~0x00000001); + executionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExecutionsFieldBuilder() + : null; + } else { + executionsBuilder_.addAllMessages(other.executions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List executions_ = + java.util.Collections.emptyList(); + + private void ensureExecutionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + executions_ = + new java.util.ArrayList( + executions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution, + com.google.cloud.workflows.executions.v1beta.Execution.Builder, + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder> + executionsBuilder_; + + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public java.util.List + getExecutionsList() { + if (executionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(executions_); + } else { + return executionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public int getExecutionsCount() { + if (executionsBuilder_ == null) { + return executions_.size(); + } else { + return executionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1beta.Execution getExecutions(int index) { + if (executionsBuilder_ == null) { + return executions_.get(index); + } else { + return executionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder setExecutions( + int index, com.google.cloud.workflows.executions.v1beta.Execution value) { + if (executionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExecutionsIsMutable(); + executions_.set(index, value); + onChanged(); + } else { + executionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder setExecutions( + int index, com.google.cloud.workflows.executions.v1beta.Execution.Builder builderForValue) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.set(index, builderForValue.build()); + onChanged(); + } else { + executionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder addExecutions(com.google.cloud.workflows.executions.v1beta.Execution value) { + if (executionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExecutionsIsMutable(); + executions_.add(value); + onChanged(); + } else { + executionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder addExecutions( + int index, com.google.cloud.workflows.executions.v1beta.Execution value) { + if (executionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExecutionsIsMutable(); + executions_.add(index, value); + onChanged(); + } else { + executionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder addExecutions( + com.google.cloud.workflows.executions.v1beta.Execution.Builder builderForValue) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.add(builderForValue.build()); + onChanged(); + } else { + executionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder addExecutions( + int index, com.google.cloud.workflows.executions.v1beta.Execution.Builder builderForValue) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.add(index, builderForValue.build()); + onChanged(); + } else { + executionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder addAllExecutions( + java.lang.Iterable + values) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, executions_); + onChanged(); + } else { + executionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder clearExecutions() { + if (executionsBuilder_ == null) { + executions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + executionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public Builder removeExecutions(int index) { + if (executionsBuilder_ == null) { + ensureExecutionsIsMutable(); + executions_.remove(index); + onChanged(); + } else { + executionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1beta.Execution.Builder getExecutionsBuilder( + int index) { + return getExecutionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder getExecutionsOrBuilder( + int index) { + if (executionsBuilder_ == null) { + return executions_.get(index); + } else { + return executionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public java.util.List + getExecutionsOrBuilderList() { + if (executionsBuilder_ != null) { + return executionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(executions_); + } + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1beta.Execution.Builder addExecutionsBuilder() { + return getExecutionsFieldBuilder() + .addBuilder(com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance()); + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public com.google.cloud.workflows.executions.v1beta.Execution.Builder addExecutionsBuilder( + int index) { + return getExecutionsFieldBuilder() + .addBuilder( + index, com.google.cloud.workflows.executions.v1beta.Execution.getDefaultInstance()); + } + /** + * + * + *
+     * The executions which match the request.
+     * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + public java.util.List + getExecutionsBuilderList() { + return getExecutionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution, + com.google.cloud.workflows.executions.v1beta.Execution.Builder, + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder> + getExecutionsFieldBuilder() { + if (executionsBuilder_ == null) { + executionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.workflows.executions.v1beta.Execution, + com.google.cloud.workflows.executions.v1beta.Execution.Builder, + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder>( + executions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + executions_ = null; + } + return executionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + private static final com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse(); + } + + public static com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExecutionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListExecutionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.workflows.executions.v1beta.ListExecutionsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponseOrBuilder.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponseOrBuilder.java new file mode 100644 index 00000000..38dd3b5d --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/workflows/executions/v1beta/executions.proto + +package com.google.cloud.workflows.executions.v1beta; + +public interface ListExecutionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.workflows.executions.v1beta.ListExecutionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + java.util.List getExecutionsList(); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + com.google.cloud.workflows.executions.v1beta.Execution getExecutions(int index); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + int getExecutionsCount(); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + java.util.List + getExecutionsOrBuilderList(); + /** + * + * + *
+   * The executions which match the request.
+   * 
+ * + * repeated .google.cloud.workflows.executions.v1beta.Execution executions = 1; + */ + com.google.cloud.workflows.executions.v1beta.ExecutionOrBuilder getExecutionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/WorkflowName.java b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/WorkflowName.java new file mode 100644 index 00000000..0782ec76 --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/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.executions.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-workflow-executions-v1beta/src/main/proto/google/cloud/workflows/executions/v1beta/executions.proto b/proto-google-cloud-workflow-executions-v1beta/src/main/proto/google/cloud/workflows/executions/v1beta/executions.proto new file mode 100644 index 00000000..5b03fdfe --- /dev/null +++ b/proto-google-cloud-workflow-executions-v1beta/src/main/proto/google/cloud/workflows/executions/v1beta/executions.proto @@ -0,0 +1,252 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.workflows.executions.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/workflows/executions/v1beta;executions"; +option java_multiple_files = true; +option java_outer_classname = "ExecutionsProto"; +option java_package = "com.google.cloud.workflows.executions.v1beta"; +option (google.api.resource_definition) = { + type: "workflows.googleapis.com/Workflow" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}" +}; + +// Executions is used to start and manage running instances of +// [Workflows][google.cloud.workflows.v1beta.Workflow] called executions. +service Executions { + option (google.api.default_host) = "workflowexecutions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of executions which belong to the workflow with + // the given name. The method returns executions of all workflow + // revisions. Returned executions are ordered by their start time (newest + // first). + rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new execution using the latest revision of the given workflow. + rpc CreateExecution(CreateExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/workflows/*}/executions" + body: "execution" + }; + option (google.api.method_signature) = "parent,execution"; + } + + // Returns an execution of the given name. + rpc GetExecution(GetExecutionRequest) returns (Execution) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancels an execution of the given name. + rpc CancelExecution(CancelExecutionRequest) returns (Execution) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} + +// A running instance of a [Workflow][google.cloud.workflows.v1beta.Workflow]. +message Execution { + option (google.api.resource) = { + type: "workflowexecutions.googleapis.com/Execution" + pattern: "projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}" + }; + + // Error describes why the execution was abnormally terminated. + message Error { + // Error payload returned by the execution, represented as a JSON string. + string payload = 1; + + // Human readable error context, helpful for debugging purposes. + string context = 2; + } + + // Describes the current state of the execution. More states may be added + // in the future. + enum State { + // Invalid state. + STATE_UNSPECIFIED = 0; + + // The execution is in progress. + ACTIVE = 1; + + // The execution finished successfully. + SUCCEEDED = 2; + + // The execution failed with an error. + FAILED = 3; + + // The execution was stopped intentionally. + CANCELLED = 4; + } + + // Output only. The resource name of the execution. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Marks the beginning of execution. + google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Marks the end of execution, successful or not. + google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the execution. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input parameters of the execution represented as a JSON string. + // The size limit is 32KB. + string argument = 5; + + // Output only. Output of the execution represented as a JSON string. The + // value can only be present if the execution's state is `SUCCEEDED`. + string result = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error which caused the execution to finish prematurely. + // The value is only present if the execution's state is `FAILED` + // or `CANCELLED`. + Error error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision of the workflow this execution is using. + string workflow_revision_id = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for the +// [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions] +// method. +message ListExecutionsRequest { + // Required. Name of the workflow for which the executions should be listed. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; + + // Maximum number of executions to return per call. + // Max supported value depends on the selected Execution view: it's 10000 for + // BASIC and 100 for FULL. The default value used if the field is not + // specified is 100, regardless of the selected view. Values greater than + // the max value will be coerced down to it. + int32 page_size = 2; + + // A page token, received from a previous `ListExecutions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListExecutions` must + // match the call that provided the page token. + string page_token = 3; + + // Optional. A view defining which fields should be filled in the returned executions. + // The API will default to the BASIC view. + ExecutionView view = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the +// [ListExecutions][google.cloud.workflows.executions.v1beta.Executions.ListExecutions] +// method. +message ListExecutionsResponse { + // The executions which match the request. + repeated Execution executions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request for the +// [CreateExecution][google.cloud.workflows.executions.v1beta.Executions.CreateExecution] +// method. +message CreateExecutionRequest { + // Required. Name of the workflow for which an execution should be created. + // Format: projects/{project}/locations/{location}/workflows/{workflow} + // The latest revision of the workflow will be used. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflows.googleapis.com/Workflow" + } + ]; + + // Required. Execution to be created. + Execution execution = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the +// [GetExecution][google.cloud.workflows.executions.v1beta.Executions.GetExecution] +// method. +message GetExecutionRequest { + // Required. Name of the execution to be retrieved. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflowexecutions.googleapis.com/Execution" + } + ]; + + // Optional. A view defining which fields should be filled in the returned execution. + // The API will default to the FULL view. + ExecutionView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the +// [CancelExecution][google.cloud.workflows.executions.v1beta.Executions.CancelExecution] +// method. +message CancelExecutionRequest { + // Required. Name of the execution to be cancelled. + // Format: + // projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workflowexecutions.googleapis.com/Execution" + } + ]; +} + +// Defines possible views for execution resource. +enum ExecutionView { + // The default / unset value. + EXECUTION_VIEW_UNSPECIFIED = 0; + + // Includes only basic metadata about the execution. + // Following fields are returned: name, start_time, end_time, state + // and workflow_revision_id. + BASIC = 1; + + // Includes all data. + FULL = 2; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..ff6df85f --- /dev/null +++ b/renovate.json @@ -0,0 +1,73 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "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-workflow-executions", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..4bdfdca9 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + workflows-executions-install-without-bom + jar + Google Cloud Workflow Executions Install Without Bom + https://github.com/googleapis/java-workflow-executions + + + + com.google.cloud.samples + shared-configuration + 1.0.21 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-workflow-executions + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.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..1e2e9108 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-workflows-executions-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Workflow Executions Samples Parent + https://github.com/googleapis/java-workflow-executions + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.21 + + + + 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..6b52c070 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + workflows-executions-snapshot + jar + Google Cloud Workflow Executions Snapshot Samples + https://github.com/googleapis/java-workflow-executions + + + + com.google.cloud.samples + shared-configuration + 1.0.21 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-workflow-executions + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.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..1a929d85 --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + workflows-executions-snippets + jar + Google Cloud Workflow Executions Snippets + https://github.com/googleapis/java-workflow-executions + + + + com.google.cloud.samples + shared-configuration + 1.0.21 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-workflow-executions + 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..ee017954 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,138 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/java-workflow-executions.git", + "sha": "6692a46cd40079e65e52d29439e649a858c398f9" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "ab0498dc4bd2bcfcb70ab257e8edfa00f86083a6", + "internalRef": "339531446" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "ea52b8a0bd560f72f376efcf45197fb7c8869120" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "workflows-executions", + "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/readme/synth.py", + ".github/release-please.yml", + ".github/snippet-bot.yml", + ".github/trusted-contribution.yml", + ".github/workflows/approve-readme.yaml", + ".github/workflows/auto-release.yaml", + ".github/workflows/ci.yaml", + ".github/workflows/formatting.yaml", + ".github/workflows/samples.yaml", + ".kokoro/build.bat", + ".kokoro/build.sh", + ".kokoro/coerce_logs.sh", + ".kokoro/common.cfg", + ".kokoro/common.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/java8.cfg", + ".kokoro/continuous/readme.cfg", + ".kokoro/dependencies.sh", + ".kokoro/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/readme.sh", + ".kokoro/release/bump_snapshot.cfg", + ".kokoro/release/common.cfg", + ".kokoro/release/common.sh", + ".kokoro/release/drop.cfg", + ".kokoro/release/drop.sh", + ".kokoro/release/promote.cfg", + ".kokoro/release/promote.sh", + ".kokoro/release/publish_javadoc.cfg", + ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/snapshot.cfg", + ".kokoro/release/snapshot.sh", + ".kokoro/release/stage.cfg", + ".kokoro/release/stage.sh", + ".kokoro/trampoline.sh", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "codecov.yaml", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClient.java", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsSettings.java", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/package-info.java", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStub.java", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/ExecutionsStubSettings.java", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsCallableFactory.java", + "google-cloud-workflow-executions/src/main/java/com/google/cloud/workflows/executions/v1beta/stub/GrpcExecutionsStub.java", + "google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/ExecutionsClientTest.java", + "google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutions.java", + "google-cloud-workflow-executions/src/test/java/com/google/cloud/workflows/executions/v1beta/MockExecutionsImpl.java", + "grpc-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsGrpc.java", + "java.header", + "license-checks.xml", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequest.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CancelExecutionRequestOrBuilder.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequest.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/CreateExecutionRequestOrBuilder.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/Execution.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionName.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionOrBuilder.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionView.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ExecutionsProto.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequest.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/GetExecutionRequestOrBuilder.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequest.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsRequestOrBuilder.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponse.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/ListExecutionsResponseOrBuilder.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/java/com/google/cloud/workflows/executions/v1beta/WorkflowName.java", + "proto-google-cloud-workflow-executions-v1beta/src/main/proto/google/cloud/workflows/executions/v1beta/executions.proto", + "renovate.json", + "samples/install-without-bom/pom.xml", + "samples/pom.xml", + "samples/snapshot/pom.xml", + "samples/snippets/pom.xml" + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..14cb3c23 --- /dev/null +++ b/synth.py @@ -0,0 +1,34 @@ +# 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-executions' +versions = ['v1beta'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + proto_path=f'google/cloud/workflows/executions/{version}', + bazel_target=f'//google/cloud/workflows/executions/{version}:google-cloud-{service}-{version}-java', + destination_name='workflow-executions', + ) + +java.common_templates() + diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..7f4fdde6 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-workflow-executions:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-workflow-executions-v1beta:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-workflow-executions-v1beta:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file