diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..1a23ea42 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,7 @@ +# Configuration for the Blunderbuss GitHub app. For more info see +# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +assign_prs_by: +- labels: + - samples + to: + - googleapis/java-samples-reviewers \ No newline at end of file diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml index 20f3acc2..47c2ba13 100644 --- a/.github/generated-files-bot.yml +++ b/.github/generated-files-bot.yml @@ -5,3 +5,7 @@ externalManifests: - type: json file: '.github/readme/synth.metadata/synth.metadata' jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 09f5aeb9..706db9ea 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-workflows.git", - "sha": "ca0c291e64a4e99e50758f5e8d6d826efee0bce6" + "sha": "b4f48a07da5e155cffa991d40588dcaa6e9ef796" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "901ddd44e9ef7887ee681b9183bbdea99437fdcc" + "sha": "16ec872dd898d7de6e1822badfac32484b5d9031" } } ] diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index e2d841d6..7513acae 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v3.0.0 + - uses: actions/github-script@v3 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index bc1554ae..7c8816a7 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,9 +4,9 @@ name: auto-release jobs: approve: runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-v') + if: contains(github.head_ref, 'release-please') steps: - - uses: actions/github-script@v3.0.0 + - uses: actions/github-script@v3 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} debug: true @@ -16,8 +16,8 @@ jobs: return; } - // only approve PRs like "chore: release " - if ( !context.payload.pull_request.title.startsWith("chore: release") ) { + // only approve PRs like "chore(master): release " + if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) { return; } diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 68302207..def8b3a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,7 +54,11 @@ jobs: with: java-version: 8 - run: java -version - - run: .kokoro/linkage-monitor.sh + - name: Install artifacts to local Maven repository + run: .kokoro/build.sh + shell: bash + - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) + uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor lint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/formatting.yaml b/.github/workflows/formatting.yaml deleted file mode 100644 index d4d367cf..00000000 --- a/.github/workflows/formatting.yaml +++ /dev/null @@ -1,25 +0,0 @@ -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/.kokoro/build.sh b/.kokoro/build.sh index e8026847..397d0e67 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -29,7 +29,7 @@ echo ${JOB_TYPE} # attempt to install 3 times with exponential backoff (starting with 10 seconds) retry_with_backoff 3 10 \ - mvn install -B -V \ + mvn install -B -V -ntp \ -DskipTests=true \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -60,6 +60,7 @@ javadoc) ;; integration) mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ -Penable-integration-tests \ -DtrimStackTrace=false \ -Dclirr.skip=true \ @@ -81,6 +82,7 @@ samples) pushd ${SAMPLES_DIR} mvn -B \ -Penable-samples \ + -ntp \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ @@ -110,8 +112,8 @@ bash .kokoro/coerce_logs.sh if [[ "${ENABLE_BUILD_COP}" == "true" ]] then - chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop - ${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-workflows + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-workflows fi echo "exiting with ${RETURN_CODE}" diff --git a/.kokoro/common.sh b/.kokoro/common.sh index a8d0ea04..ace89f45 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -25,7 +25,6 @@ function retry_with_backoff { # allow a failures to continue set +e - echo "${command}" ${command} exit_code=$? diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index c91e5a56..0fb8c843 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -31,7 +31,7 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer retry_with_backoff 3 10 \ - mvn install -B -V \ + mvn install -B -V -ntp \ -DskipTests=true \ -Dclirr.skip=true @@ -86,4 +86,4 @@ then else msg "Errors found. See log statements above." exit 1 -fi \ No newline at end of file +fi diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh deleted file mode 100755 index 759ab4e2..00000000 --- a/.kokoro/linkage-monitor.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/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/readme.sh b/.kokoro/readme.sh index e80df3f3..9609b8fd 100755 --- a/.kokoro/readme.sh +++ b/.kokoro/readme.sh @@ -28,9 +28,18 @@ 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 + +set +e python3.6 -m autosynth.synth \ --repository=googleapis/java-workflows \ --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 + --branch-suffix="readme" + +# autosynth returns 28 to signal there are no changes +RETURN_CODE=$? +if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] +then + exit ${RETURN_CODE} +fi diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index 9eb0c3f9..d46041cf 100644 --- a/.kokoro/release/publish_javadoc.cfg +++ b/.kokoro/release/publish_javadoc.cfg @@ -7,10 +7,10 @@ env_vars: { value: "docs-staging" } +# cloud-rad staging env_vars: { key: "STAGING_BUCKET_V2" value: "docs-staging-v2-staging" - # Production will be at: docs-staging-v2 } env_vars: { @@ -26,4 +26,4 @@ before_action { keyname: "docuploader_service_account" } } -} +} \ No newline at end of file diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh index e1a8287e..f0933ab2 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -38,8 +38,8 @@ python3 -m pip install gcp-docuploader # compile all packages mvn clean install -B -q -DskipTests=true -NAME=google-cloud-workflows -VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) +export NAME=google-cloud-workflows +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) # build the docs mvn site -B -q @@ -59,7 +59,8 @@ python3 -m docuploader upload . \ popd -# V2 +# V2 due to problems w/ the released javadoc plugin doclava, Java 8 is required. Beware of accidental updates. + mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" pushd target/devsite/reference @@ -70,7 +71,7 @@ python3 -m docuploader create-metadata \ --version ${VERSION} \ --language java -# upload docs +# upload docs to staging bucket python3 -m docuploader upload . \ --credentials ${CREDENTIALS} \ --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg new file mode 100644 index 00000000..0be16400 --- /dev/null +++ b/.kokoro/release/publish_javadoc11.cfg @@ -0,0 +1,30 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# cloud-rad production +env_vars: { + key: "STAGING_BUCKET_V2" + value: "docs-staging-v2" +} + +# Configure the docker image for kokoro-trampoline +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java11" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-workflows/.kokoro/release/publish_javadoc11.sh" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + +# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh new file mode 100755 index 00000000..ff3e0b85 --- /dev/null +++ b/.kokoro/release/publish_javadoc11.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright 2021 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_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 + +export NAME=google-cloud-workflows +export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) + +# V3 generates docfx yml from javadoc +# generate yml +mvn clean site -B -q -P docFX + +pushd target/docfx-yml + +# create metadata +python3 -m docuploader create-metadata \ + --name ${NAME} \ + --version ${VERSION} \ + --language java + +# upload yml to production bucket +python3 -m docuploader upload . \ + --credentials ${CREDENTIALS} \ + --staging-bucket ${STAGING_BUCKET_V2} \ + --destination-prefix docfx- diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 3c482cbc..16126d2e 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -20,19 +20,22 @@ python3 -m pip install gcp-releasetool python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script source $(dirname "$0")/common.sh +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} +# attempt to stage 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index a155a43a..40058051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [0.2.0](https://www.github.com/googleapis/java-workflows/compare/v0.1.4...v0.2.0) (2021-02-22) + + +### Features + +* migrate to microgenerator ([#159](https://www.github.com/googleapis/java-workflows/issues/159)) ([fb32524](https://www.github.com/googleapis/java-workflows/commit/fb325248049da0109eb142107e91e0ae2b8ee39e)) + + +### Bug Fixes + +* update repo name ([#182](https://www.github.com/googleapis/java-workflows/issues/182)) ([529aa0e](https://www.github.com/googleapis/java-workflows/commit/529aa0e71150e7e6c1f99627e0bfc6c81b8a22dd)) + + +### Documentation + +* generate sample code in the Java microgenerator ([#185](https://www.github.com/googleapis/java-workflows/issues/185)) ([592501d](https://www.github.com/googleapis/java-workflows/commit/592501d6150886bf9531e669733f4dd3ed7f5fa8)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#151](https://www.github.com/googleapis/java-workflows/issues/151)) ([a3003c8](https://www.github.com/googleapis/java-workflows/commit/a3003c8b601668c0e6b656aebf1fc1476083b4a2)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([ec15f27](https://www.github.com/googleapis/java-workflows/commit/ec15f2794dad3d9acfca3e9b7ccb876cd9be17f6)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#166](https://www.github.com/googleapis/java-workflows/issues/166)) ([96e5909](https://www.github.com/googleapis/java-workflows/commit/96e5909d2ba0607e84df54f42df350a13a8eadf7)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.18.0 ([#171](https://www.github.com/googleapis/java-workflows/issues/171)) ([39e348c](https://www.github.com/googleapis/java-workflows/commit/39e348cb0012893da1a1fa37f00e28175928f0ce)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#193](https://www.github.com/googleapis/java-workflows/issues/193)) ([098dbaa](https://www.github.com/googleapis/java-workflows/commit/098dbaaec94fe7fd9f0ea8c4a46c953a4dff2d70)) + ### [0.1.4](https://www.github.com/googleapis/java-workflows/compare/v0.1.3...v0.1.4) (2020-11-02) diff --git a/LICENSE b/LICENSE index d6456956..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/README.md b/README.md index 5cc58824..9a39e749 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,19 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-workflows - 0.1.3 + 0.1.4 ``` -If you are using Gradle, add this to your dependencies +If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-workflows:0.1.3' +compile 'com.google.cloud:google-cloud-workflows:0.1.4' ``` + If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-workflows" % "0.1.3" +libraryDependencies += "com.google.cloud" % "google-cloud-workflows" % "0.1.4" ``` ## Authentication @@ -112,6 +113,8 @@ 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] +Java is a registered trademark of Oracle and/or its affiliates. + [product-docs]: https://cloud.google.com/workflows [javadocs]: https://googleapis.dev/java/google-cloud-workflows/latest/index.html [kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-workflows/java7.svg diff --git a/google-cloud-workflows-bom/pom.xml b/google-cloud-workflows-bom/pom.xml index 3fa21d29..3ab98e04 100644 --- a/google-cloud-workflows-bom/pom.xml +++ b/google-cloud-workflows-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-workflows-bom - 0.1.4 + 0.2.0 pom com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 Google Cloud Workflows BOM @@ -68,17 +68,17 @@ com.google.cloud google-cloud-workflows - 0.1.4 + 0.2.0 com.google.api.grpc proto-google-cloud-workflows-v1beta - 0.1.4 + 0.2.0 com.google.api.grpc grpc-google-cloud-workflows-v1beta - 0.1.4 + 0.2.0 diff --git a/google-cloud-workflows/pom.xml b/google-cloud-workflows/pom.xml index a613545f..39064e43 100644 --- a/google-cloud-workflows/pom.xml +++ b/google-cloud-workflows/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-workflows - 0.1.4 + 0.2.0 jar Google Cloud Workflows https://github.com/googleapis/java-workflows @@ -11,7 +11,7 @@ com.google.cloud google-cloud-workflows-parent - 0.1.4 + 0.2.0 google-cloud-workflows @@ -68,7 +68,7 @@ junit junit test - 4.13.1 + 4.13.2 diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java index 1198df31..b72b74b7 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta; import com.google.api.core.ApiFunction; @@ -39,7 +40,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Workflows is used to deploy and execute workflow programs. Workflows makes * sure the program executes reliably, despite hardware and networking interruptions. @@ -47,16 +48,14 @@ *

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

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

Note: close() needs to be called on the workflowsClient object to clean up resources such as + *

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

The surface of this class includes several types of Java methods for each of the API's @@ -84,30 +83,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * WorkflowsSettings workflowsSettings =
  *     WorkflowsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * WorkflowsClient workflowsClient =
- *     WorkflowsClient.create(workflowsSettings);
- * 
- * 
+ * WorkflowsClient workflowsClient = WorkflowsClient.create(workflowsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

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

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class WorkflowsClient implements BackgroundResource { private final WorkflowsSettings settings; private final WorkflowsStub stub; @@ -128,7 +123,7 @@ public static final WorkflowsClient create(WorkflowsSettings settings) throws IO /** * Constructs an instance of WorkflowsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use WorkflowsSettings}. + * advanced usage - prefer using create(WorkflowsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final WorkflowsClient create(WorkflowsStub stub) { @@ -165,26 +160,24 @@ public WorkflowsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Workflows in a given project and location. The default order is not specified. * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
    *   for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
-   * 
+ * }
* * @param parent Required. Project and location from which the workflows should be listed. Format: * projects/{project}/locations/{location} @@ -198,20 +191,20 @@ public final ListWorkflowsPagedResponse listWorkflows(LocationName parent) { return listWorkflows(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Workflows in a given project and location. The default order is not specified. * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Workflow element : workflowsClient.listWorkflows(parent.toString()).iterateAll()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Workflow element : workflowsClient.listWorkflows(parent).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
-   * 
+ * }
* * @param parent Required. Project and location from which the workflows should be listed. Format: * projects/{project}/locations/{location} @@ -222,23 +215,27 @@ public final ListWorkflowsPagedResponse listWorkflows(String parent) { return listWorkflows(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists Workflows in a given project and location. The default order is not specified. * *

Sample code: * - *


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

Sample code: * - *


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

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListWorkflowsRequest request = ListWorkflowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
    *   while (true) {
    *     ListWorkflowsResponse response = workflowsClient.listWorkflowsCallable().call(request);
-   *     for (Workflow element : response.getWorkflowsList()) {
+   *     for (Workflow element : response.getResponsesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -297,24 +294,24 @@ public final ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest reque
    *     }
    *   }
    * }
-   * 
+ * }
*/ public final UnaryCallable listWorkflowsCallable() { return stub.listWorkflowsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Workflow. * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
    *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
    *   Workflow response = workflowsClient.getWorkflow(name);
    * }
-   * 
+ * }
* * @param name Required. Name of the workflow which information should be retrieved. Format: * projects/{project}/locations/{location}/workflows/{workflow} @@ -326,18 +323,18 @@ public final Workflow getWorkflow(WorkflowName name) { return getWorkflow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Workflow. * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
-   *   Workflow response = workflowsClient.getWorkflow(name.toString());
+   *   String name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString();
+   *   Workflow response = workflowsClient.getWorkflow(name);
    * }
-   * 
+ * }
* * @param name Required. Name of the workflow which information should be retrieved. Format: * projects/{project}/locations/{location}/workflows/{workflow} @@ -348,21 +345,21 @@ public final Workflow getWorkflow(String name) { return getWorkflow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets details of a single Workflow. * *

Sample code: * - *


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

Sample code: * - *


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

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
    *   Workflow workflow = Workflow.newBuilder().build();
-   *   String workflowId = "";
+   *   String workflowId = "workflowId-360387270";
    *   Workflow response = workflowsClient.createWorkflowAsync(parent, workflow, workflowId).get();
    * }
-   * 
+ * }
* * @param parent Required. Project and location in which the workflow should be created. Format: * projects/{project}/locations/{location} * @param workflow Required. Workflow to be created. * @param workflowId Required. The ID of the workflow to be created. It has to fulfill the * following requirements: - *

* Must contain only letters, numbers, underscores and hyphens. * Must start with - * a letter. * Must be between 1-64 characters. * Must end with a number or a letter. - * * Must be unique within the customer project and location. + *

    + *
  • Must contain only letters, numbers, underscores and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-64 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project and location. + *
+ * * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createWorkflowAsync( LocationName parent, Workflow workflow, String workflowId) { CreateWorkflowRequest request = @@ -433,7 +433,7 @@ public final OperationFuture createWorkflowAsync( return createWorkflowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new workflow. If a workflow with the specified name already exists in the specified * project and location, the long running operation will return @@ -441,27 +441,30 @@ public final OperationFuture createWorkflowAsync( * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
    *   Workflow workflow = Workflow.newBuilder().build();
-   *   String workflowId = "";
-   *   Workflow response = workflowsClient.createWorkflowAsync(parent.toString(), workflow, workflowId).get();
+   *   String workflowId = "workflowId-360387270";
+   *   Workflow response = workflowsClient.createWorkflowAsync(parent, workflow, workflowId).get();
    * }
-   * 
+ * }
* * @param parent Required. Project and location in which the workflow should be created. Format: * projects/{project}/locations/{location} * @param workflow Required. Workflow to be created. * @param workflowId Required. The ID of the workflow to be created. It has to fulfill the * following requirements: - *

* Must contain only letters, numbers, underscores and hyphens. * Must start with - * a letter. * Must be between 1-64 characters. * Must end with a number or a letter. - * * Must be unique within the customer project and location. + *

    + *
  • Must contain only letters, numbers, underscores and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-64 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project and location. + *
+ * * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createWorkflowAsync( String parent, Workflow workflow, String workflowId) { CreateWorkflowRequest request = @@ -473,7 +476,7 @@ public final OperationFuture createWorkflowAsync( return createWorkflowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new workflow. If a workflow with the specified name already exists in the specified * project and location, the long running operation will return @@ -481,31 +484,27 @@ public final OperationFuture createWorkflowAsync( * *

Sample code: * - *


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

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Workflow workflow = Workflow.newBuilder().build();
-   *   String workflowId = "";
-   *   CreateWorkflowRequest request = CreateWorkflowRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setWorkflow(workflow)
-   *     .setWorkflowId(workflowId)
-   *     .build();
-   *   OperationFuture<Workflow, OperationMetadata> future = workflowsClient.createWorkflowOperationCallable().futureCall(request);
-   *   // Do something
+   *   CreateWorkflowRequest request =
+   *       CreateWorkflowRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setWorkflowId("workflowId-360387270")
+   *           .build();
+   *   OperationFuture future =
+   *       workflowsClient.createWorkflowOperationCallable().futureCall(request);
+   *   // Do something.
    *   Workflow response = future.get();
    * }
-   * 
+ * }
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable createWorkflowOperationCallable() { return stub.createWorkflowOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new workflow. If a workflow with the specified name already exists in the specified * project and location, the long running operation will return @@ -543,153 +540,145 @@ public final OperationFuture createWorkflowAsync( * *

Sample code: * - *


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

Sample code: * - *


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

Sample code: * - *


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

Sample code: * - *


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

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
-   *   DeleteWorkflowRequest request = DeleteWorkflowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, OperationMetadata> future = workflowsClient.deleteWorkflowOperationCallable().futureCall(request);
-   *   // Do something
+   *   DeleteWorkflowRequest request =
+   *       DeleteWorkflowRequest.newBuilder()
+   *           .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       workflowsClient.deleteWorkflowOperationCallable().futureCall(request);
+   *   // Do something.
    *   future.get();
    * }
-   * 
+ * }
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable deleteWorkflowOperationCallable() { return stub.deleteWorkflowOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a workflow with the specified name. This method also cancels and deletes all running * executions of the workflow. * *

Sample code: * - *


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

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
    *   Workflow workflow = Workflow.newBuilder().build();
    *   FieldMask updateMask = FieldMask.newBuilder().build();
    *   Workflow response = workflowsClient.updateWorkflowAsync(workflow, updateMask).get();
    * }
-   * 
+ * }
* * @param workflow Required. Workflow to be updated. * @param updateMask List of fields to be updated. If not present, the entire workflow will be * updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture updateWorkflowAsync( Workflow workflow, FieldMask updateMask) { UpdateWorkflowRequest request = @@ -719,7 +706,7 @@ public final OperationFuture updateWorkflowAsync( return updateWorkflowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an existing workflow. Running this method has no impact on already running executions * of the workflow. A new revision of the workflow may be created as a result of a successful @@ -727,27 +714,26 @@ public final OperationFuture updateWorkflowAsync( * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   Workflow workflow = Workflow.newBuilder().build();
-   *   UpdateWorkflowRequest request = UpdateWorkflowRequest.newBuilder()
-   *     .setWorkflow(workflow)
-   *     .build();
+   *   UpdateWorkflowRequest request =
+   *       UpdateWorkflowRequest.newBuilder()
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
    *   Workflow response = workflowsClient.updateWorkflowAsync(request).get();
    * }
-   * 
+ * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture updateWorkflowAsync( UpdateWorkflowRequest request) { return updateWorkflowOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an existing workflow. Running this method has no impact on already running executions * of the workflow. A new revision of the workflow may be created as a result of a successful @@ -755,25 +741,26 @@ public final OperationFuture updateWorkflowAsync( * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   Workflow workflow = Workflow.newBuilder().build();
-   *   UpdateWorkflowRequest request = UpdateWorkflowRequest.newBuilder()
-   *     .setWorkflow(workflow)
-   *     .build();
-   *   OperationFuture<Workflow, OperationMetadata> future = workflowsClient.updateWorkflowOperationCallable().futureCall(request);
-   *   // Do something
+   *   UpdateWorkflowRequest request =
+   *       UpdateWorkflowRequest.newBuilder()
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       workflowsClient.updateWorkflowOperationCallable().futureCall(request);
+   *   // Do something.
    *   Workflow response = future.get();
    * }
-   * 
+ * }
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable updateWorkflowOperationCallable() { return stub.updateWorkflowOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an existing workflow. Running this method has no impact on already running executions * of the workflow. A new revision of the workflow may be created as a result of a successful @@ -781,17 +768,18 @@ public final OperationFuture updateWorkflowAsync( * *

Sample code: * - *


+   * 
{@code
    * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
-   *   Workflow workflow = Workflow.newBuilder().build();
-   *   UpdateWorkflowRequest request = UpdateWorkflowRequest.newBuilder()
-   *     .setWorkflow(workflow)
-   *     .build();
-   *   ApiFuture<Operation> future = workflowsClient.updateWorkflowCallable().futureCall(request);
-   *   // Do something
+   *   UpdateWorkflowRequest request =
+   *       UpdateWorkflowRequest.newBuilder()
+   *           .setWorkflow(Workflow.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = workflowsClient.updateWorkflowCallable().futureCall(request);
+   *   // Do something.
    *   Operation response = future.get();
    * }
-   * 
+ * }
*/ public final UnaryCallable updateWorkflowCallable() { return stub.updateWorkflowCallable(); diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java index a160c792..9cb128c0 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta; import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; @@ -36,7 +37,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link WorkflowsClient}. * @@ -53,23 +54,24 @@ * *

For example, to set the total timeout of getWorkflow to 30 seconds: * - *

- * 
- * WorkflowsSettings.Builder workflowsSettingsBuilder =
- *     WorkflowsSettings.newBuilder();
+ * 
{@code
+ * WorkflowsSettings.Builder workflowsSettingsBuilder = WorkflowsSettings.newBuilder();
  * workflowsSettingsBuilder
  *     .getWorkflowSettings()
  *     .setRetrySettings(
- *         workflowsSettingsBuilder.getWorkflowSettings().getRetrySettings().toBuilder()
+ *         workflowsSettingsBuilder
+ *             .getWorkflowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WorkflowsSettings workflowsSettings = workflowsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class WorkflowsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listWorkflows. */ public PagedCallSettings listWorkflowsSettings() { @@ -87,8 +89,6 @@ public UnaryCallSettings createWorkflowSetting } /** Returns the object with the settings used for calls to createWorkflow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings createWorkflowOperationSettings() { return ((WorkflowsStubSettings) getStubSettings()).createWorkflowOperationSettings(); @@ -100,8 +100,6 @@ public UnaryCallSettings deleteWorkflowSetting } /** Returns the object with the settings used for calls to deleteWorkflow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings deleteWorkflowOperationSettings() { return ((WorkflowsStubSettings) getStubSettings()).deleteWorkflowOperationSettings(); @@ -113,8 +111,6 @@ public UnaryCallSettings updateWorkflowSetting } /** Returns the object with the settings used for calls to updateWorkflow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings updateWorkflowOperationSettings() { return ((WorkflowsStubSettings) getStubSettings()).updateWorkflowOperationSettings(); @@ -179,18 +175,15 @@ protected WorkflowsSettings(Builder settingsBuilder) throws IOException { /** Builder for WorkflowsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(WorkflowsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(WorkflowsStubSettings.newBuilder()); - } - protected Builder(WorkflowsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -199,11 +192,15 @@ protected Builder(WorkflowsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(WorkflowsStubSettings.newBuilder()); + } + public WorkflowsStubSettings.Builder getStubSettingsBuilder() { return ((WorkflowsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -234,8 +231,6 @@ public UnaryCallSettings.Builder createWorkflo } /** Returns the builder for the settings used for calls to createWorkflow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder createWorkflowOperationSettings() { return getStubSettingsBuilder().createWorkflowOperationSettings(); @@ -247,8 +242,6 @@ public UnaryCallSettings.Builder deleteWorkflo } /** Returns the builder for the settings used for calls to deleteWorkflow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder deleteWorkflowOperationSettings() { return getStubSettingsBuilder().deleteWorkflowOperationSettings(); @@ -260,8 +253,6 @@ public UnaryCallSettings.Builder updateWorkflo } /** Returns the builder for the settings used for calls to updateWorkflow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder updateWorkflowOperationSettings() { return getStubSettingsBuilder().updateWorkflowOperationSettings(); diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/gapic_metadata.json b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/gapic_metadata.json new file mode 100644 index 00000000..680c243b --- /dev/null +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.workflows.v1beta", + "libraryPackage": "com.google.cloud.workflows.v1beta", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "WorkflowsClient", + "rpcs": { + "CreateWorkflow": { + "methods": ["createWorkflowAsync", "createWorkflowAsync", "createWorkflowAsync", "createWorkflowOperationCallable", "createWorkflowCallable"] + }, + "DeleteWorkflow": { + "methods": ["deleteWorkflowAsync", "deleteWorkflowAsync", "deleteWorkflowAsync", "deleteWorkflowOperationCallable", "deleteWorkflowCallable"] + }, + "GetWorkflow": { + "methods": ["getWorkflow", "getWorkflow", "getWorkflow", "getWorkflowCallable"] + }, + "ListWorkflows": { + "methods": ["listWorkflows", "listWorkflows", "listWorkflows", "listWorkflowsPagedCallable", "listWorkflowsCallable"] + }, + "UpdateWorkflow": { + "methods": ["updateWorkflowAsync", "updateWorkflowAsync", "updateWorkflowOperationCallable", "updateWorkflowCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java index f8aedba1..f4483118 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -15,27 +15,23 @@ */ /** - * A client to Workflows API. + * The interfaces provided are listed below, along with usage samples. * - *

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

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

======================= WorkflowsClient ======================= * *

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

Sample for WorkflowsClient: * - *

- * 
+ * 
{@code
  * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) {
  *   WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]");
  *   Workflow response = workflowsClient.getWorkflow(name);
  * }
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.workflows.v1beta; import javax.annotation.Generated; diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java index 732aaaeb..3cefee50 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta.stub; import com.google.api.core.BetaApi; @@ -31,18 +32,20 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Workflows API. + * gRPC callable factory implementation for the Workflows service 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.") +@BetaApi +@Generated("by gapic-generator-java") public class GrpcWorkflowsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +58,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, 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, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java index fa8d6fc3..9b2d24ba 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta.stub; import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; @@ -45,16 +46,15 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Workflows API. + * gRPC stub implementation for the Workflows service 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") +@BetaApi +@Generated("by gapic-generator-java") public class GrpcWorkflowsStub extends WorkflowsStub { - private static final MethodDescriptor listWorkflowsMethodDescriptor = MethodDescriptor.newBuilder() @@ -65,6 +65,7 @@ public class GrpcWorkflowsStub extends WorkflowsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListWorkflowsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getWorkflowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -72,6 +73,7 @@ public class GrpcWorkflowsStub extends WorkflowsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetWorkflowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Workflow.getDefaultInstance())) .build(); + private static final MethodDescriptor createWorkflowMethodDescriptor = MethodDescriptor.newBuilder() @@ -81,6 +83,7 @@ public class GrpcWorkflowsStub extends WorkflowsStub { ProtoUtils.marshaller(CreateWorkflowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteWorkflowMethodDescriptor = MethodDescriptor.newBuilder() @@ -90,6 +93,7 @@ public class GrpcWorkflowsStub extends WorkflowsStub { ProtoUtils.marshaller(DeleteWorkflowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor updateWorkflowMethodDescriptor = MethodDescriptor.newBuilder() @@ -100,9 +104,6 @@ public class GrpcWorkflowsStub extends WorkflowsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listWorkflowsCallable; private final UnaryCallable listWorkflowsPagedCallable; @@ -117,6 +118,8 @@ public class GrpcWorkflowsStub extends WorkflowsStub { private final OperationCallable updateWorkflowOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcWorkflowsStub create(WorkflowsStubSettings settings) throws IOException { @@ -239,7 +242,7 @@ public Map extract(UpdateWorkflowRequest request) { createWorkflowTransportSettings, settings.createWorkflowOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.deleteWorkflowCallable = callableFactory.createUnaryCallable( deleteWorkflowTransportSettings, settings.deleteWorkflowSettings(), clientContext); @@ -248,7 +251,7 @@ public Map extract(UpdateWorkflowRequest request) { deleteWorkflowTransportSettings, settings.deleteWorkflowOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.updateWorkflowCallable = callableFactory.createUnaryCallable( updateWorkflowTransportSettings, settings.updateWorkflowSettings(), clientContext); @@ -257,59 +260,65 @@ public Map extract(UpdateWorkflowRequest request) { updateWorkflowTransportSettings, settings.updateWorkflowOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override + public UnaryCallable listWorkflowsCallable() { + return listWorkflowsCallable; + } + + @Override public UnaryCallable listWorkflowsPagedCallable() { return listWorkflowsPagedCallable; } - public UnaryCallable listWorkflowsCallable() { - return listWorkflowsCallable; - } - + @Override public UnaryCallable getWorkflowCallable() { return getWorkflowCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + @Override + public UnaryCallable createWorkflowCallable() { + return createWorkflowCallable; + } + + @Override public OperationCallable createWorkflowOperationCallable() { return createWorkflowOperationCallable; } - public UnaryCallable createWorkflowCallable() { - return createWorkflowCallable; + @Override + public UnaryCallable deleteWorkflowCallable() { + return deleteWorkflowCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + @Override public OperationCallable deleteWorkflowOperationCallable() { return deleteWorkflowOperationCallable; } - public UnaryCallable deleteWorkflowCallable() { - return deleteWorkflowCallable; + @Override + public UnaryCallable updateWorkflowCallable() { + return updateWorkflowCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + @Override public OperationCallable updateWorkflowOperationCallable() { return updateWorkflowOperationCallable; } - public UnaryCallable updateWorkflowCallable() { - return updateWorkflowCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java index 675445f3..232dab40 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStub.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta.stub; import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; @@ -34,17 +35,16 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Workflows API. + * Base stub class for the Workflows service 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") +@BetaApi +@Generated("by gapic-generator-java") public abstract class WorkflowsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -62,7 +62,6 @@ public UnaryCallable getWorkflowCallable() { throw new UnsupportedOperationException("Not implemented: getWorkflowCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createWorkflowOperationCallable() { throw new UnsupportedOperationException("Not implemented: createWorkflowOperationCallable()"); @@ -72,7 +71,6 @@ public UnaryCallable createWorkflowCallable() throw new UnsupportedOperationException("Not implemented: createWorkflowCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable deleteWorkflowOperationCallable() { throw new UnsupportedOperationException("Not implemented: deleteWorkflowOperationCallable()"); @@ -82,7 +80,6 @@ public UnaryCallable deleteWorkflowCallable() throw new UnsupportedOperationException("Not implemented: deleteWorkflowCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable updateWorkflowOperationCallable() { throw new UnsupportedOperationException("Not implemented: updateWorkflowOperationCallable()"); diff --git a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java index bfa79e98..9a31ccd7 100644 --- a/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java +++ b/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/WorkflowsStubSettings.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta.stub; import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; @@ -62,7 +63,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link WorkflowsStub}. * @@ -79,22 +80,22 @@ * *

For example, to set the total timeout of getWorkflow to 30 seconds: * - *

- * 
- * WorkflowsStubSettings.Builder workflowsSettingsBuilder =
- *     WorkflowsStubSettings.newBuilder();
+ * 
{@code
+ * WorkflowsStubSettings.Builder workflowsSettingsBuilder = WorkflowsStubSettings.newBuilder();
  * workflowsSettingsBuilder
  *     .getWorkflowSettings()
  *     .setRetrySettings(
- *         workflowsSettingsBuilder.getWorkflowSettings().getRetrySettings().toBuilder()
+ *         workflowsSettingsBuilder
+ *             .getWorkflowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WorkflowsStubSettings workflowsSettings = workflowsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class WorkflowsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -114,6 +115,59 @@ public class WorkflowsStubSettings extends StubSettings { private final OperationCallSettings updateWorkflowOperationSettings; + private static final PagedListDescriptor + LIST_WORKFLOWS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWorkflowsRequest injectToken(ListWorkflowsRequest payload, String token) { + return ListWorkflowsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWorkflowsRequest injectPageSize(ListWorkflowsRequest payload, int pageSize) { + return ListWorkflowsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWorkflowsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWorkflowsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWorkflowsResponse payload) { + return payload.getWorkflowsList() == null + ? ImmutableList.of() + : payload.getWorkflowsList(); + } + }; + + private static final PagedListResponseFactory< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> + LIST_WORKFLOWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWorkflowsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WORKFLOWS_PAGE_STR_DESC, request, context); + return ListWorkflowsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listWorkflows. */ public PagedCallSettings listWorkflowsSettings() { @@ -131,7 +185,6 @@ public UnaryCallSettings createWorkflowSetting } /** Returns the object with the settings used for calls to createWorkflow. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings createWorkflowOperationSettings() { return createWorkflowOperationSettings; @@ -143,7 +196,6 @@ public UnaryCallSettings deleteWorkflowSetting } /** Returns the object with the settings used for calls to deleteWorkflow. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings deleteWorkflowOperationSettings() { return deleteWorkflowOperationSettings; @@ -155,7 +207,6 @@ public UnaryCallSettings updateWorkflowSetting } /** Returns the object with the settings used for calls to updateWorkflow. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings updateWorkflowOperationSettings() { return updateWorkflowOperationSettings; @@ -167,10 +218,10 @@ public WorkflowsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcWorkflowsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -239,63 +290,9 @@ protected WorkflowsStubSettings(Builder settingsBuilder) throws IOException { updateWorkflowOperationSettings = settingsBuilder.updateWorkflowOperationSettings().build(); } - private static final PagedListDescriptor - LIST_WORKFLOWS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListWorkflowsRequest injectToken(ListWorkflowsRequest payload, String token) { - return ListWorkflowsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListWorkflowsRequest injectPageSize(ListWorkflowsRequest payload, int pageSize) { - return ListWorkflowsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListWorkflowsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListWorkflowsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListWorkflowsResponse payload) { - return payload.getWorkflowsList() != null - ? payload.getWorkflowsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> - LIST_WORKFLOWS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListWorkflowsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_WORKFLOWS_PAGE_STR_DESC, request, context); - return ListWorkflowsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for WorkflowsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListWorkflowsRequest, ListWorkflowsResponse, ListWorkflowsPagedResponse> listWorkflowsSettings; @@ -312,19 +309,13 @@ public static class Builder extends StubSettings.Builder updateWorkflowOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; static { ImmutableMap.Builder> definitions = ImmutableMap.builder(); - definitions.put( - "idempotent", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -333,41 +324,25 @@ public static class Builder extends StubSettings.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); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(clientContext); listWorkflowsSettings = PagedCallSettings.newBuilder(LIST_WORKFLOWS_PAGE_STR_FACT); - getWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createWorkflowOperationSettings = OperationCallSettings.newBuilder(); - deleteWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteWorkflowOperationSettings = OperationCallSettings.newBuilder(); - updateWorkflowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateWorkflowOperationSettings = OperationCallSettings.newBuilder(); unaryMethodSettingsBuilders = @@ -377,52 +352,74 @@ protected Builder(ClientContext clientContext) { createWorkflowSettings, deleteWorkflowSettings, updateWorkflowSettings); - initDefaults(this); } + protected Builder(WorkflowsStubSettings settings) { + super(settings); + + listWorkflowsSettings = settings.listWorkflowsSettings.toBuilder(); + getWorkflowSettings = settings.getWorkflowSettings.toBuilder(); + createWorkflowSettings = settings.createWorkflowSettings.toBuilder(); + createWorkflowOperationSettings = settings.createWorkflowOperationSettings.toBuilder(); + deleteWorkflowSettings = settings.deleteWorkflowSettings.toBuilder(); + deleteWorkflowOperationSettings = settings.deleteWorkflowOperationSettings.toBuilder(); + updateWorkflowSettings = settings.updateWorkflowSettings.toBuilder(); + updateWorkflowOperationSettings = settings.updateWorkflowOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listWorkflowsSettings, + getWorkflowSettings, + createWorkflowSettings, + deleteWorkflowSettings, + updateWorkflowSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listWorkflowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .getWorkflowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .createWorkflowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .deleteWorkflowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .updateWorkflowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .createWorkflowOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Workflow.class)) @@ -431,21 +428,22 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .deleteWorkflowOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -454,21 +452,22 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .updateWorkflowOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Workflow.class)) @@ -477,40 +476,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(WorkflowsStubSettings settings) { - super(settings); - - listWorkflowsSettings = settings.listWorkflowsSettings.toBuilder(); - getWorkflowSettings = settings.getWorkflowSettings.toBuilder(); - createWorkflowSettings = settings.createWorkflowSettings.toBuilder(); - createWorkflowOperationSettings = settings.createWorkflowOperationSettings.toBuilder(); - deleteWorkflowSettings = settings.deleteWorkflowSettings.toBuilder(); - deleteWorkflowOperationSettings = settings.deleteWorkflowOperationSettings.toBuilder(); - updateWorkflowSettings = settings.updateWorkflowSettings.toBuilder(); - updateWorkflowOperationSettings = settings.updateWorkflowOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listWorkflowsSettings, - getWorkflowSettings, - createWorkflowSettings, - deleteWorkflowSettings, - updateWorkflowSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java index 07c903de..fbb118b8 100644 --- a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java +++ b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflows.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockWorkflows implements MockGrpcService { private final MockWorkflowsImpl serviceImpl; diff --git a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java index ffd5087f..5de99bdc 100644 --- a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java +++ b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockWorkflowsImpl extends WorkflowsImplBase { private List requests; private Queue responses; @@ -63,12 +65,18 @@ public void listWorkflows( Object response = responses.remove(); if (response instanceof ListWorkflowsResponse) { requests.add(request); - responseObserver.onNext((ListWorkflowsResponse) response); + responseObserver.onNext(((ListWorkflowsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListWorkflows, expected %s or %s", + response.getClass().getName(), + ListWorkflowsResponse.class.getName(), + Exception.class.getName()))); } } @@ -77,12 +85,18 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver res Object response = responses.remove(); if (response instanceof Workflow) { requests.add(request); - responseObserver.onNext((Workflow) response); + responseObserver.onNext(((Workflow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetWorkflow, expected %s or %s", + response.getClass().getName(), + Workflow.class.getName(), + Exception.class.getName()))); } } @@ -92,12 +106,18 @@ public void createWorkflow( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateWorkflow, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -107,12 +127,18 @@ public void deleteWorkflow( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteWorkflow, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -122,12 +148,18 @@ public void updateWorkflow( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateWorkflow, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java index 6bfa8a8d..429611ce 100644 --- a/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java +++ b/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/WorkflowsClientTest.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.workflows.v1beta; import static com.google.cloud.workflows.v1beta.WorkflowsClient.ListWorkflowsPagedResponse; @@ -31,13 +32,15 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,31 +48,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class WorkflowsClientTest { - private static MockWorkflows mockWorkflows; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private WorkflowsClient client; private LocalChannelProvider channelProvider; + private static MockWorkflows mockWorkflows; @BeforeClass public static void startStaticServer() { mockWorkflows = new MockWorkflows(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), Arrays.asList(mockWorkflows)); - serviceHelper.start(); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); WorkflowsSettings settings = WorkflowsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -84,15 +87,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listWorkflowsTest() { - String nextPageToken = ""; - Workflow workflowsElement = Workflow.newBuilder().build(); - List workflows = Arrays.asList(workflowsElement); + public void listWorkflowsTest() throws Exception { + Workflow responsesElement = Workflow.newBuilder().build(); ListWorkflowsResponse expectedResponse = ListWorkflowsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllWorkflows(workflows) + .setNextPageToken("") + .addAllWorkflows(Arrays.asList(responsesElement)) .build(); mockWorkflows.addResponse(expectedResponse); @@ -101,14 +101,15 @@ public void listWorkflowsTest() { ListWorkflowsPagedResponse pagedListResponse = client.listWorkflows(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getWorkflowsList().get(0), resources.get(0)); List actualRequests = mockWorkflows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListWorkflowsRequest actualRequest = (ListWorkflowsRequest) actualRequests.get(0); + ListWorkflowsRequest actualRequest = ((ListWorkflowsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -116,36 +117,75 @@ public void listWorkflowsTest() { } @Test - @SuppressWarnings("all") public void listWorkflowsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWorkflows.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listWorkflows(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWorkflowsTest2() throws Exception { + Workflow responsesElement = Workflow.newBuilder().build(); + ListWorkflowsResponse expectedResponse = + ListWorkflowsResponse.newBuilder() + .setNextPageToken("") + .addAllWorkflows(Arrays.asList(responsesElement)) + .build(); + mockWorkflows.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWorkflowsPagedResponse pagedListResponse = client.listWorkflows(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWorkflowsList().get(0), resources.get(0)); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWorkflowsRequest actualRequest = ((ListWorkflowsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWorkflowsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + try { + String parent = "parent-995424086"; client.listWorkflows(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getWorkflowTest() { - WorkflowName name2 = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); - String description = "description-1724546052"; - String revisionId = "revisionId513861631"; - String serviceAccount = "serviceAccount-1948028253"; - String sourceContents = "sourceContents-1799875906"; + public void getWorkflowTest() throws Exception { Workflow expectedResponse = Workflow.newBuilder() - .setName(name2.toString()) - .setDescription(description) - .setRevisionId(revisionId) - .setServiceAccount(serviceAccount) - .setSourceContents(sourceContents) + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); mockWorkflows.addResponse(expectedResponse); @@ -156,9 +196,9 @@ public void getWorkflowTest() { List actualRequests = mockWorkflows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetWorkflowRequest actualRequest = (GetWorkflowRequest) actualRequests.get(0); + GetWorkflowRequest actualRequest = ((GetWorkflowRequest) actualRequests.get(0)); - Assert.assertEquals(name, WorkflowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -166,36 +206,76 @@ public void getWorkflowTest() { } @Test - @SuppressWarnings("all") public void getWorkflowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWorkflows.addException(exception); try { WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + client.getWorkflow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWorkflowTest2() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + mockWorkflows.addResponse(expectedResponse); + String name = "name3373707"; + + Workflow actualResponse = client.getWorkflow(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWorkflowRequest actualRequest = ((GetWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWorkflowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String name = "name3373707"; client.getWorkflow(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void createWorkflowTest() throws Exception { - WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); - String description = "description-1724546052"; - String revisionId = "revisionId513861631"; - String serviceAccount = "serviceAccount-1948028253"; - String sourceContents = "sourceContents-1799875906"; Workflow expectedResponse = Workflow.newBuilder() - .setName(name.toString()) - .setDescription(description) - .setRevisionId(revisionId) - .setServiceAccount(serviceAccount) - .setSourceContents(sourceContents) + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); Operation resultOperation = Operation.newBuilder() @@ -207,16 +287,16 @@ public void createWorkflowTest() throws Exception { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Workflow workflow = Workflow.newBuilder().build(); - String workflowId = "workflowId1712917915"; + String workflowId = "workflowId-360387270"; Workflow actualResponse = client.createWorkflowAsync(parent, workflow, workflowId).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockWorkflows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateWorkflowRequest actualRequest = (CreateWorkflowRequest) actualRequests.get(0); + CreateWorkflowRequest actualRequest = ((CreateWorkflowRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(workflow, actualRequest.getWorkflow()); Assert.assertEquals(workflowId, actualRequest.getWorkflowId()); Assert.assertTrue( @@ -226,27 +306,83 @@ public void createWorkflowTest() throws Exception { } @Test - @SuppressWarnings("all") public void createWorkflowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWorkflows.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Workflow workflow = Workflow.newBuilder().build(); - String workflowId = "workflowId1712917915"; + String workflowId = "workflowId-360387270"; + client.createWorkflowAsync(parent, workflow, workflowId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createWorkflowTest2() throws Exception { + Workflow expectedResponse = + Workflow.newBuilder() + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + String parent = "parent-995424086"; + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId-360387270"; + + Workflow actualResponse = client.createWorkflowAsync(parent, workflow, workflowId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWorkflowRequest actualRequest = ((CreateWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(workflow, actualRequest.getWorkflow()); + Assert.assertEquals(workflowId, actualRequest.getWorkflowId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWorkflowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String parent = "parent-995424086"; + Workflow workflow = Workflow.newBuilder().build(); + String workflowId = "workflowId-360387270"; client.createWorkflowAsync(parent, workflow, workflowId).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") public void deleteWorkflowTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -259,14 +395,13 @@ public void deleteWorkflowTest() throws Exception { WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); - Empty actualResponse = client.deleteWorkflowAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteWorkflowAsync(name).get(); List actualRequests = mockWorkflows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteWorkflowRequest actualRequest = (DeleteWorkflowRequest) actualRequests.get(0); + DeleteWorkflowRequest actualRequest = ((DeleteWorkflowRequest) actualRequests.get(0)); - Assert.assertEquals(name, WorkflowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -274,38 +409,75 @@ public void deleteWorkflowTest() throws Exception { } @Test - @SuppressWarnings("all") public void deleteWorkflowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWorkflows.addException(exception); try { WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); + client.deleteWorkflowAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteWorkflowTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteWorkflowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockWorkflows.addResponse(resultOperation); + String name = "name3373707"; + + client.deleteWorkflowAsync(name).get(); + + List actualRequests = mockWorkflows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWorkflowRequest actualRequest = ((DeleteWorkflowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWorkflowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWorkflows.addException(exception); + + try { + String name = "name3373707"; client.deleteWorkflowAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") public void updateWorkflowTest() throws Exception { - WorkflowName name = WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]"); - String description = "description-1724546052"; - String revisionId = "revisionId513861631"; - String serviceAccount = "serviceAccount-1948028253"; - String sourceContents = "sourceContents-1799875906"; Workflow expectedResponse = Workflow.newBuilder() - .setName(name.toString()) - .setDescription(description) - .setRevisionId(revisionId) - .setServiceAccount(serviceAccount) - .setSourceContents(sourceContents) + .setName(WorkflowName.of("[PROJECT]", "[LOCATION]", "[WORKFLOW]").toString()) + .setDescription("description-1724546052") + .setRevisionId("revisionId-1507445162") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRevisionCreateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setServiceAccount("serviceAccount1079137720") .build(); Operation resultOperation = Operation.newBuilder() @@ -323,7 +495,7 @@ public void updateWorkflowTest() throws Exception { List actualRequests = mockWorkflows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateWorkflowRequest actualRequest = (UpdateWorkflowRequest) actualRequests.get(0); + UpdateWorkflowRequest actualRequest = ((UpdateWorkflowRequest) actualRequests.get(0)); Assert.assertEquals(workflow, actualRequest.getWorkflow()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -334,20 +506,18 @@ public void updateWorkflowTest() throws Exception { } @Test - @SuppressWarnings("all") public void updateWorkflowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWorkflows.addException(exception); try { Workflow workflow = Workflow.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateWorkflowAsync(workflow, updateMask).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/grpc-google-cloud-workflows-v1beta/pom.xml b/grpc-google-cloud-workflows-v1beta/pom.xml index 7d436ec7..3a2ac516 100644 --- a/grpc-google-cloud-workflows-v1beta/pom.xml +++ b/grpc-google-cloud-workflows-v1beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-workflows-v1beta - 0.1.4 + 0.2.0 grpc-google-cloud-workflows-v1beta GRPC library for google-cloud-workflows com.google.cloud google-cloud-workflows-parent - 0.1.4 + 0.2.0 diff --git a/pom.xml b/pom.xml index e491c13d..117ce9b7 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-workflows-parent pom - 0.1.4 + 0.2.0 Google Cloud Workflows Parent https://github.com/googleapis/java- @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 @@ -70,23 +70,23 @@ com.google.cloud google-cloud-workflows - 0.1.4 + 0.2.0 com.google.api.grpc proto-google-cloud-workflows-v1beta - 0.1.4 + 0.2.0 com.google.api.grpc grpc-google-cloud-workflows-v1beta - 0.1.4 + 0.2.0 com.google.cloud google-cloud-shared-dependencies - 0.14.1 + 0.19.0 pom import diff --git a/proto-google-cloud-workflows-v1beta/pom.xml b/proto-google-cloud-workflows-v1beta/pom.xml index a20a3daf..6321e5b3 100644 --- a/proto-google-cloud-workflows-v1beta/pom.xml +++ b/proto-google-cloud-workflows-v1beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-workflows-v1beta - 0.1.4 + 0.2.0 proto-google-cloud-workflows-v1beta Proto library for google-cloud-workflows com.google.cloud google-cloud-workflows-parent - 0.1.4 + 0.2.0 diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java index de22e3e3..aa792b8f 100644 --- a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/LocationName.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -23,19 +23,29 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class LocationName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION = PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + public String getProject() { return project; } @@ -52,11 +62,6 @@ public Builder toBuilder() { return new Builder(this); } - private LocationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - } - public static LocationName of(String project, String location) { return newBuilder().setProject(project).setLocation(location).build(); } @@ -70,7 +75,7 @@ public static LocationName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION.validatedMatch( formattedString, "LocationName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location")); } @@ -84,7 +89,7 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (LocationName value : values) { if (value == null) { list.add(""); @@ -96,16 +101,21 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -119,15 +129,39 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "location", location); + return PROJECT_LOCATION.instantiate("project", project, "location", location); } - /** Builder for LocationName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { private String project; private String location; + protected Builder() {} + public String getProject() { return project; } @@ -146,8 +180,6 @@ public Builder setLocation(String location) { return this; } - private Builder() {} - private Builder(LocationName locationName) { project = locationName.project; location = locationName.location; @@ -157,26 +189,4 @@ public LocationName build() { return new LocationName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof LocationName) { - LocationName that = (LocationName) o; - return (this.project.equals(that.project)) && (this.location.equals(that.location)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - return h; - } } diff --git a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java index 04e77584..be7e2369 100644 --- a/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java +++ b/proto-google-cloud-workflows-v1beta/src/main/java/com/google/cloud/workflows/v1beta/WorkflowName.java @@ -5,7 +5,7 @@ * 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 + * 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, @@ -23,21 +23,33 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class WorkflowName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_WORKFLOW = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/workflows/{workflow}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String workflow; + @Deprecated + protected WorkflowName() { + project = null; + location = null; + workflow = null; + } + + private WorkflowName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + workflow = Preconditions.checkNotNull(builder.getWorkflow()); + } + public String getProject() { return project; } @@ -58,12 +70,6 @@ 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(); } @@ -82,7 +88,7 @@ public static WorkflowName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_WORKFLOW.validatedMatch( formattedString, "WorkflowName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("workflow")); } @@ -96,7 +102,7 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (WorkflowName value : values) { if (value == null) { list.add(""); @@ -108,17 +114,24 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_WORKFLOW.matches(formattedString); } + @Override 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); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (workflow != null) { + fieldMapBuilder.put("workflow", workflow); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -132,17 +145,44 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_WORKFLOW.instantiate( "project", project, "location", location, "workflow", workflow); } - /** Builder for WorkflowName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WorkflowName that = ((WorkflowName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.workflow, that.workflow); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(workflow); + return h; + } + + /** Builder for projects/{project}/locations/{location}/workflows/{workflow}. */ + public static class Builder { private String project; private String location; private String workflow; + protected Builder() {} + public String getProject() { return project; } @@ -170,8 +210,6 @@ public Builder setWorkflow(String workflow) { return this; } - private Builder() {} - private Builder(WorkflowName workflowName) { project = workflowName.project; location = workflowName.location; @@ -182,30 +220,4 @@ 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/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index adfe1b86..e78c1539 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,20 +29,20 @@ com.google.cloud google-cloud-workflows - 0.1.3 + 0.1.4 junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 504351a7..9d220356 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,20 +28,20 @@ com.google.cloud google-cloud-workflows - 0.1.4 + 0.2.0 junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 723ef44d..fb6e7ac9 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,19 +28,19 @@ com.google.cloud google-cloud-workflows - 0.1.3 + 0.1.4 junit junit - 4.13.1 + 4.13.2 test com.google.truth truth - 1.1 + 1.1.2 test diff --git a/synth.metadata b/synth.metadata index 65df0581..61a077a5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-workflows.git", - "sha": "33bf0e897de62bd6b00152839af4879c610d2f26" + "sha": "098dbaaec94fe7fd9f0ea8c4a46c953a4dff2d70" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ba5a928ab823d97dc6b7042ff32130d19b002f75", - "internalRef": "331550506" + "sha": "af8f71dae961ee036a0ac52a1965270149a6b2c9", + "internalRef": "358516065" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b19b401571e77192f8dd38eab5fb2300a0de9324" + "sha": "6946fd71ae9215b0e7ae188f5057df765ee6d7d2" } } ], @@ -40,6 +40,7 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", + ".github/blunderbuss.yml", ".github/generated-files-bot.yml", ".github/readme/synth.py", ".github/release-please.yml", @@ -48,7 +49,6 @@ ".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", @@ -59,7 +59,6 @@ ".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", @@ -91,6 +90,8 @@ ".kokoro/release/promote.sh", ".kokoro/release/publish_javadoc.cfg", ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/publish_javadoc11.cfg", + ".kokoro/release/publish_javadoc11.sh", ".kokoro/release/snapshot.cfg", ".kokoro/release/snapshot.sh", ".kokoro/release/stage.cfg", @@ -102,6 +103,7 @@ "codecov.yaml", "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java", "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsSettings.java", + "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/gapic_metadata.json", "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/package-info.java", "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsCallableFactory.java", "google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/stub/GrpcWorkflowsStub.java", diff --git a/versions.txt b/versions.txt index 29430f35..33214504 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-workflows:0.1.4:0.1.4 -proto-google-cloud-workflows-v1beta:0.1.4:0.1.4 -grpc-google-cloud-workflows-v1beta:0.1.4:0.1.4 \ No newline at end of file +google-cloud-workflows:0.2.0:0.2.0 +proto-google-cloud-workflows-v1beta:0.2.0:0.2.0 +grpc-google-cloud-workflows-v1beta:0.2.0:0.2.0 \ No newline at end of file