diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 590b3ce5..556b633d 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-functions.git", - "sha": "deb9710ae39296cc9d3dd8659fd47f8efd2661ae" + "sha": "77440a61a1a25c72cf3ce4dda0b50e41801371b6" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "67f09bf301083798e7220137723222eb00b8f88a" + "sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e" } } ] diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml index 2b6cdbc9..7c8816a7 100644 --- a/.github/workflows/auto-release.yaml +++ b/.github/workflows/auto-release.yaml @@ -4,7 +4,7 @@ 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 with: @@ -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/.kokoro/build.sh b/.kokoro/build.sh index 0b13a768..f9876228 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-functions + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-functions fi echo "exiting with ${RETURN_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/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg index b9c14da9..6c200fd8 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" - # Production will be at: docs-staging-v2 + value: "docs-staging-v2-staging" } 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 3789eac4..4030b7d3 100755 --- a/.kokoro/release/publish_javadoc.sh +++ b/.kokoro/release/publish_javadoc.sh @@ -71,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..05c4998e --- /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-functions/.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..2f4bd1c7 --- /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-functions +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/CHANGELOG.md b/CHANGELOG.md index a368c424..500038d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +### [1.0.7](https://www.github.com/googleapis/java-functions/compare/v1.0.6...v1.0.7) (2021-02-22) + + +### Documentation + +* generate sample code in the Java microgenerator ([#135](https://www.github.com/googleapis/java-functions/issues/135)) ([77440a6](https://www.github.com/googleapis/java-functions/commit/77440a61a1a25c72cf3ce4dda0b50e41801371b6)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#145](https://www.github.com/googleapis/java-functions/issues/145)) ([3034804](https://www.github.com/googleapis/java-functions/commit/3034804aa7bf022f8763ca6db12a92d2d2bdba14)) + ### [1.0.6](https://www.github.com/googleapis/java-functions/compare/v1.0.5...v1.0.6) (2021-01-14) 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 4b3e6213..8fe000bb 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ If you are using Maven, add this to your pom.xml file: If you are using Gradle without BOM, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-functions:1.0.5' +compile 'com.google.cloud:google-cloud-functions:1.0.6' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "1.0.5" +libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "1.0.6" ``` ## Authentication diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index 7206a3f1..ac2a9bc2 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.google.cloud google-cloud-functions-bom - 1.0.6 + 1.0.7 pom com.google.cloud google-cloud-shared-config - 0.9.4 + 0.10.0 Google Cloud Functions BOM @@ -68,17 +68,17 @@ com.google.cloud google-cloud-functions - 1.0.6 + 1.0.7 com.google.api.grpc proto-google-cloud-functions-v1 - 1.0.6 + 1.0.7 com.google.api.grpc grpc-google-cloud-functions-v1 - 1.0.6 + 1.0.7 diff --git a/google-cloud-functions/pom.xml b/google-cloud-functions/pom.xml index f5b74d38..877ab6c4 100644 --- a/google-cloud-functions/pom.xml +++ b/google-cloud-functions/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-functions - 1.0.6 + 1.0.7 jar Google Cloud Functions https://github.com/googleapis/java-functions @@ -11,7 +11,7 @@ com.google.cloud google-cloud-functions-parent - 1.0.6 + 1.0.7 google-cloud-functions diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java index 6b1f8071..e54bdb68 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java @@ -51,6 +51,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 (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+ *     CloudFunctionsServiceClient.create()) {
+ *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+ *   CloudFunction response = cloudFunctionsServiceClient.getFunction(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the CloudFunctionsServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -168,6 +176,24 @@ public final OperationsClient getOperationsClient() { /** * Returns a list of functions that belong to the requested project. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (CloudFunction element :
+   *       cloudFunctionsServiceClient.listFunctions(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 */ @@ -180,6 +206,24 @@ public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest reque * Returns a list of functions that belong to the requested project. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFunctionsServiceClient.listFunctionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (CloudFunction element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listFunctionsPagedCallable() { @@ -191,6 +235,25 @@ public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest reque * Returns a list of functions that belong to the requested project. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   while (true) {
+   *     ListFunctionsResponse response =
+   *         cloudFunctionsServiceClient.listFunctionsCallable().call(request);
+   *     for (CloudFunction element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listFunctionsCallable() { return stub.listFunctionsCallable(); @@ -200,6 +263,16 @@ public final UnaryCallable listFunc /** * Returns a function with the given name from the requested project. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   CloudFunction response = cloudFunctionsServiceClient.getFunction(name);
+   * }
+   * }
+ * * @param name Required. The name of the function which details should be obtained. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -213,6 +286,16 @@ public final CloudFunction getFunction(CloudFunctionName name) { /** * Returns a function with the given name from the requested project. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   String name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   CloudFunction response = cloudFunctionsServiceClient.getFunction(name);
+   * }
+   * }
+ * * @param name Required. The name of the function which details should be obtained. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -225,6 +308,19 @@ public final CloudFunction getFunction(String name) { /** * Returns a function with the given name from the requested project. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   GetFunctionRequest request =
+   *       GetFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   CloudFunction response = cloudFunctionsServiceClient.getFunction(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 */ @@ -237,6 +333,20 @@ public final CloudFunction getFunction(GetFunctionRequest request) { * Returns a function with the given name from the requested project. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   GetFunctionRequest request =
+   *       GetFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFunctionsServiceClient.getFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   CloudFunction response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getFunctionCallable() { return stub.getFunctionCallable(); @@ -247,6 +357,18 @@ public final UnaryCallable getFunctionCallabl * Creates a new function. If a function with the given name already exists in the specified * project, the long running operation will return `ALREADY_EXISTS` error. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CloudFunction response =
+   *       cloudFunctionsServiceClient.createFunctionAsync(location, function).get();
+   * }
+   * }
+ * * @param location Required. The project and location in which the function should be created, * specified in the format `projects/*/locations/*` * @param function Required. Function to be created. @@ -267,6 +389,18 @@ public final OperationFuture createFunctionA * Creates a new function. If a function with the given name already exists in the specified * project, the long running operation will return `ALREADY_EXISTS` error. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   String location = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CloudFunction response =
+   *       cloudFunctionsServiceClient.createFunctionAsync(location, function).get();
+   * }
+   * }
+ * * @param location Required. The project and location in which the function should be created, * specified in the format `projects/*/locations/*` * @param function Required. Function to be created. @@ -284,6 +418,20 @@ public final OperationFuture createFunctionA * Creates a new function. If a function with the given name already exists in the specified * project, the long running operation will return `ALREADY_EXISTS` error. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(CloudFunction.newBuilder().build())
+   *           .build();
+   *   CloudFunction response = cloudFunctionsServiceClient.createFunctionAsync(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 */ @@ -298,6 +446,21 @@ public final OperationFuture createFunctionA * project, the long running operation will return `ALREADY_EXISTS` error. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(CloudFunction.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFunctionsServiceClient.createFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   CloudFunction response = future.get();
+   * }
+   * }
*/ public final OperationCallable createFunctionOperationCallable() { @@ -310,6 +473,21 @@ public final OperationFuture createFunctionA * project, the long running operation will return `ALREADY_EXISTS` error. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(CloudFunction.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFunctionsServiceClient.createFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createFunctionCallable() { return stub.createFunctionCallable(); @@ -319,6 +497,16 @@ public final UnaryCallable createFunctionCalla /** * Updates existing function. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CloudFunction response = cloudFunctionsServiceClient.updateFunctionAsync(function).get();
+   * }
+   * }
+ * * @param function Required. New version of the function. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -333,6 +521,20 @@ public final OperationFuture updateFunctionA /** * Updates existing function. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(CloudFunction.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CloudFunction response = cloudFunctionsServiceClient.updateFunctionAsync(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 */ @@ -346,6 +548,21 @@ public final OperationFuture updateFunctionA * Updates existing function. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(CloudFunction.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFunctionsServiceClient.updateFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   CloudFunction response = future.get();
+   * }
+   * }
*/ public final OperationCallable updateFunctionOperationCallable() { @@ -357,6 +574,21 @@ public final OperationFuture updateFunctionA * Updates existing function. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(CloudFunction.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFunctionsServiceClient.updateFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateFunctionCallable() { return stub.updateFunctionCallable(); @@ -367,6 +599,16 @@ public final UnaryCallable updateFunctionCalla * Deletes a function with the given name from the specified project. If the given function is * used by some trigger, the trigger will be updated to remove this function. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   cloudFunctionsServiceClient.deleteFunctionAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the function which should be deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -382,6 +624,16 @@ public final OperationFuture deleteFunctionAsync( * Deletes a function with the given name from the specified project. If the given function is * used by some trigger, the trigger will be updated to remove this function. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   String name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   cloudFunctionsServiceClient.deleteFunctionAsync(name).get();
+   * }
+   * }
+ * * @param name Required. The name of the function which should be deleted. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -395,6 +647,19 @@ public final OperationFuture deleteFunctionAsync(Str * Deletes a function with the given name from the specified project. If the given function is * used by some trigger, the trigger will be updated to remove this function. * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   cloudFunctionsServiceClient.deleteFunctionAsync(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 */ @@ -409,6 +674,20 @@ public final OperationFuture deleteFunctionAsync( * used by some trigger, the trigger will be updated to remove this function. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       cloudFunctionsServiceClient.deleteFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final OperationCallable deleteFunctionOperationCallable() { @@ -421,6 +700,20 @@ public final OperationFuture deleteFunctionAsync( * used by some trigger, the trigger will be updated to remove this function. * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFunctionsServiceClient.deleteFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteFunctionCallable() { return stub.deleteFunctionCallable(); @@ -432,6 +725,17 @@ public final UnaryCallable deleteFunctionCalla * limited traffic is allowed. For more information on the actual limits, refer to [Rate * Limits](https://cloud.google.com/functions/quotas#rate_limits). * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   String data = "data3076010";
+   *   CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(name, data);
+   * }
+   * }
+ * * @param name Required. The name of the function to be called. * @param data Required. Input to be passed to the function. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -451,6 +755,17 @@ public final CallFunctionResponse callFunction(CloudFunctionName name, String da * limited traffic is allowed. For more information on the actual limits, refer to [Rate * Limits](https://cloud.google.com/functions/quotas#rate_limits). * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   String name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   String data = "data3076010";
+   *   CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(name, data);
+   * }
+   * }
+ * * @param name Required. The name of the function to be called. * @param data Required. Input to be passed to the function. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -467,6 +782,20 @@ public final CallFunctionResponse callFunction(String name, String data) { * limited traffic is allowed. For more information on the actual limits, refer to [Rate * Limits](https://cloud.google.com/functions/quotas#rate_limits). * + *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CallFunctionRequest request =
+   *       CallFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setData("data3076010")
+   *           .build();
+   *   CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(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 */ @@ -481,6 +810,21 @@ public final CallFunctionResponse callFunction(CallFunctionRequest request) { * Limits](https://cloud.google.com/functions/quotas#rate_limits). * *

Sample code: + * + *

{@code
+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
+   *     CloudFunctionsServiceClient.create()) {
+   *   CallFunctionRequest request =
+   *       CallFunctionRequest.newBuilder()
+   *           .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setData("data3076010")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudFunctionsServiceClient.callFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   CallFunctionResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable callFunctionCallable() { return stub.callFunctionCallable(); @@ -517,6 +861,17 @@ public final UnaryCallable callFuncti *
  • `Authorization: Bearer YOUR_TOKEN` * * + *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   GenerateUploadUrlRequest request =
    +   *       GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build();
    +   *   GenerateUploadUrlResponse response = cloudFunctionsServiceClient.generateUploadUrl(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 */ @@ -556,6 +911,18 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques * * *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   GenerateUploadUrlRequest request =
    +   *       GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build();
    +   *   ApiFuture future =
    +   *       cloudFunctionsServiceClient.generateUploadUrlCallable().futureCall(request);
    +   *   // Do something.
    +   *   GenerateUploadUrlResponse response = future.get();
    +   * }
    +   * }
    */ public final UnaryCallable generateUploadUrlCallable() { @@ -568,6 +935,21 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques * limited period and should be used within minutes after generation. For more information about * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls * + *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   GenerateDownloadUrlRequest request =
    +   *       GenerateDownloadUrlRequest.newBuilder()
    +   *           .setName("name3373707")
    +   *           .setVersionId(-670497310)
    +   *           .build();
    +   *   GenerateDownloadUrlResponse response =
    +   *       cloudFunctionsServiceClient.generateDownloadUrl(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 */ @@ -582,6 +964,21 @@ public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrl * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls * *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   GenerateDownloadUrlRequest request =
    +   *       GenerateDownloadUrlRequest.newBuilder()
    +   *           .setName("name3373707")
    +   *           .setVersionId(-670497310)
    +   *           .build();
    +   *   ApiFuture future =
    +   *       cloudFunctionsServiceClient.generateDownloadUrlCallable().futureCall(request);
    +   *   // Do something.
    +   *   GenerateDownloadUrlResponse response = future.get();
    +   * }
    +   * }
    */ public final UnaryCallable generateDownloadUrlCallable() { @@ -592,6 +989,20 @@ public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrl /** * Sets the IAM access control policy on the specified function. Replaces any existing policy. * + *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   SetIamPolicyRequest request =
    +   *       SetIamPolicyRequest.newBuilder()
    +   *           .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
    +   *           .setPolicy(Policy.newBuilder().build())
    +   *           .build();
    +   *   Policy response = cloudFunctionsServiceClient.setIamPolicy(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 */ @@ -604,6 +1015,21 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * Sets the IAM access control policy on the specified function. Replaces any existing policy. * *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   SetIamPolicyRequest request =
    +   *       SetIamPolicyRequest.newBuilder()
    +   *           .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
    +   *           .setPolicy(Policy.newBuilder().build())
    +   *           .build();
    +   *   ApiFuture future =
    +   *       cloudFunctionsServiceClient.setIamPolicyCallable().futureCall(request);
    +   *   // Do something.
    +   *   Policy response = future.get();
    +   * }
    +   * }
    */ public final UnaryCallable setIamPolicyCallable() { return stub.setIamPolicyCallable(); @@ -614,6 +1040,20 @@ public final UnaryCallable setIamPolicyCallable() { * Gets the IAM access control policy for a function. Returns an empty policy if the function * exists and does not have a policy set. * + *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   GetIamPolicyRequest request =
    +   *       GetIamPolicyRequest.newBuilder()
    +   *           .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
    +   *           .setOptions(GetPolicyOptions.newBuilder().build())
    +   *           .build();
    +   *   Policy response = cloudFunctionsServiceClient.getIamPolicy(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 */ @@ -627,6 +1067,21 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * exists and does not have a policy set. * *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   GetIamPolicyRequest request =
    +   *       GetIamPolicyRequest.newBuilder()
    +   *           .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
    +   *           .setOptions(GetPolicyOptions.newBuilder().build())
    +   *           .build();
    +   *   ApiFuture future =
    +   *       cloudFunctionsServiceClient.getIamPolicyCallable().futureCall(request);
    +   *   // Do something.
    +   *   Policy response = future.get();
    +   * }
    +   * }
    */ public final UnaryCallable getIamPolicyCallable() { return stub.getIamPolicyCallable(); @@ -637,6 +1092,20 @@ public final UnaryCallable getIamPolicyCallable() { * Tests the specified permissions against the IAM access control policy for a function. If the * function does not exist, this will return an empty set of permissions, not a NOT_FOUND error. * + *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   TestIamPermissionsRequest request =
    +   *       TestIamPermissionsRequest.newBuilder()
    +   *           .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
    +   *           .addAllPermissions(new ArrayList())
    +   *           .build();
    +   *   TestIamPermissionsResponse response = cloudFunctionsServiceClient.testIamPermissions(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 */ @@ -650,6 +1119,21 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * function does not exist, this will return an empty set of permissions, not a NOT_FOUND error. * *

    Sample code: + * + *

    {@code
    +   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    +   *     CloudFunctionsServiceClient.create()) {
    +   *   TestIamPermissionsRequest request =
    +   *       TestIamPermissionsRequest.newBuilder()
    +   *           .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
    +   *           .addAllPermissions(new ArrayList())
    +   *           .build();
    +   *   ApiFuture future =
    +   *       cloudFunctionsServiceClient.testIamPermissionsCallable().futureCall(request);
    +   *   // Do something.
    +   *   TestIamPermissionsResponse response = future.get();
    +   * }
    +   * }
    */ public final UnaryCallable testIamPermissionsCallable() { diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/gapic_metadata.json b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/gapic_metadata.json new file mode 100644 index 00000000..8da09403 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.functions.v1", + "libraryPackage": "com.google.cloud.functions.v1", + "services": { + "CloudFunctionsService": { + "clients": { + "grpc": { + "libraryClient": "CloudFunctionsServiceClient", + "rpcs": { + "CallFunction": { + "methods": ["callFunction", "callFunction", "callFunction", "callFunctionCallable"] + }, + "CreateFunction": { + "methods": ["createFunctionAsync", "createFunctionAsync", "createFunctionAsync", "createFunctionOperationCallable", "createFunctionCallable"] + }, + "DeleteFunction": { + "methods": ["deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionOperationCallable", "deleteFunctionCallable"] + }, + "GenerateDownloadUrl": { + "methods": ["generateDownloadUrl", "generateDownloadUrlCallable"] + }, + "GenerateUploadUrl": { + "methods": ["generateUploadUrl", "generateUploadUrlCallable"] + }, + "GetFunction": { + "methods": ["getFunction", "getFunction", "getFunction", "getFunctionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "ListFunctions": { + "methods": ["listFunctions", "listFunctionsPagedCallable", "listFunctionsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateFunction": { + "methods": ["updateFunctionAsync", "updateFunctionAsync", "updateFunctionOperationCallable", "updateFunctionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java index 5e9e48c0..414df439 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java @@ -22,6 +22,14 @@ *

    Service Description: A service that application uses to manipulate triggers and functions. * *

    Sample for CloudFunctionsServiceClient: + * + *

    {@code
    + * try (CloudFunctionsServiceClient cloudFunctionsServiceClient =
    + *     CloudFunctionsServiceClient.create()) {
    + *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
    + *   CloudFunction response = cloudFunctionsServiceClient.getFunction(name);
    + * }
    + * }
    */ @Generated("by gapic-generator-java") package com.google.cloud.functions.v1; diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java index 90d93531..cfa1c317 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java @@ -459,68 +459,83 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable listFunctionsCallable() { return listFunctionsCallable; } + @Override public UnaryCallable listFunctionsPagedCallable() { return listFunctionsPagedCallable; } + @Override public UnaryCallable getFunctionCallable() { return getFunctionCallable; } + @Override public UnaryCallable createFunctionCallable() { return createFunctionCallable; } + @Override public OperationCallable createFunctionOperationCallable() { return createFunctionOperationCallable; } + @Override public UnaryCallable updateFunctionCallable() { return updateFunctionCallable; } + @Override public OperationCallable updateFunctionOperationCallable() { return updateFunctionOperationCallable; } + @Override public UnaryCallable deleteFunctionCallable() { return deleteFunctionCallable; } + @Override public OperationCallable deleteFunctionOperationCallable() { return deleteFunctionOperationCallable; } + @Override public UnaryCallable callFunctionCallable() { return callFunctionCallable; } + @Override public UnaryCallable generateUploadUrlCallable() { return generateUploadUrlCallable; } + @Override public UnaryCallable generateDownloadUrlCallable() { return generateDownloadUrlCallable; } + @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } + @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java index 03118c8f..0907d4af 100644 --- a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java @@ -158,6 +158,7 @@ public void getFunctionTest() throws Exception { CloudFunction.newBuilder() .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) .setEntryPoint("entryPoint-1979329474") .setRuntime("runtime1550962648") .setTimeout(Duration.newBuilder().build()) @@ -210,6 +211,7 @@ public void getFunctionTest2() throws Exception { CloudFunction.newBuilder() .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) .setEntryPoint("entryPoint-1979329474") .setRuntime("runtime1550962648") .setTimeout(Duration.newBuilder().build()) @@ -262,6 +264,7 @@ public void createFunctionTest() throws Exception { CloudFunction.newBuilder() .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) .setEntryPoint("entryPoint-1979329474") .setRuntime("runtime1550962648") .setTimeout(Duration.newBuilder().build()) @@ -325,6 +328,7 @@ public void createFunctionTest2() throws Exception { CloudFunction.newBuilder() .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) .setEntryPoint("entryPoint-1979329474") .setRuntime("runtime1550962648") .setTimeout(Duration.newBuilder().build()) @@ -388,6 +392,7 @@ public void updateFunctionTest() throws Exception { CloudFunction.newBuilder() .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) .setEntryPoint("entryPoint-1979329474") .setRuntime("runtime1550962648") .setTimeout(Duration.newBuilder().build()) diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsServiceImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsServiceImpl.java index c6115e71..220f12d3 100644 --- a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsServiceImpl.java +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsServiceImpl.java @@ -75,7 +75,13 @@ public void listFunctions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListFunctions, expected %s or %s", + response.getClass().getName(), + ListFunctionsResponse.class.getName(), + Exception.class.getName()))); } } @@ -90,7 +96,13 @@ public void getFunction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetFunction, expected %s or %s", + response.getClass().getName(), + CloudFunction.class.getName(), + Exception.class.getName()))); } } @@ -105,7 +117,13 @@ public void createFunction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateFunction, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -120,7 +138,13 @@ public void updateFunction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateFunction, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -135,7 +159,13 @@ public void deleteFunction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteFunction, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -150,7 +180,13 @@ public void callFunction( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CallFunction, expected %s or %s", + response.getClass().getName(), + CallFunctionResponse.class.getName(), + Exception.class.getName()))); } } @@ -166,7 +202,13 @@ public void generateUploadUrl( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateUploadUrl, expected %s or %s", + response.getClass().getName(), + GenerateUploadUrlResponse.class.getName(), + Exception.class.getName()))); } } @@ -182,7 +224,13 @@ public void generateDownloadUrl( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateDownloadUrl, expected %s or %s", + response.getClass().getName(), + GenerateDownloadUrlResponse.class.getName(), + Exception.class.getName()))); } } @@ -196,7 +244,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -210,7 +264,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -226,7 +286,13 @@ public void testIamPermissions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/grpc-google-cloud-functions-v1/pom.xml b/grpc-google-cloud-functions-v1/pom.xml index 6a54ca02..89f7dc87 100644 --- a/grpc-google-cloud-functions-v1/pom.xml +++ b/grpc-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 1.0.6 + 1.0.7 grpc-google-cloud-functions-v1 GRPC library for grpc-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 1.0.6 + 1.0.7 diff --git a/pom.xml b/pom.xml index 4e948aa4..a098f462 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-functions-parent pom - 1.0.6 + 1.0.7 Google Cloud Functions Parent https://github.com/googleapis/java-functions @@ -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-functions - 1.0.6 + 1.0.7 com.google.api.grpc proto-google-cloud-functions-v1 - 1.0.6 + 1.0.7 com.google.api.grpc grpc-google-cloud-functions-v1 - 1.0.6 + 1.0.7 com.google.cloud google-cloud-shared-dependencies - 0.18.0 + 0.19.0 pom import @@ -94,7 +94,7 @@ junit junit - 4.13.1 + 4.13.2 test diff --git a/proto-google-cloud-functions-v1/pom.xml b/proto-google-cloud-functions-v1/pom.xml index 9a097279..b198a489 100644 --- a/proto-google-cloud-functions-v1/pom.xml +++ b/proto-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v1 - 1.0.6 + 1.0.7 proto-google-cloud-functions-v1 PROTO library for proto-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 1.0.6 + 1.0.7 diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 1c51d384..719f9d5d 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -36,13 +36,13 @@ 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 97c3e9e1..2cd8d0f1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -35,13 +35,13 @@ 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 f036eb0e..4d75109f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -34,13 +34,13 @@ 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 27b5b599..e6a1e22e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-functions.git", - "sha": "39033b699ec9a2382d8052e282d39888c3d974c1" + "sha": "3034804aa7bf022f8763ca6db12a92d2d2bdba14" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "af8f71dae961ee036a0ac52a1965270149a6b2c9", + "internalRef": "358516065" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6133907dbb3ddab204a17a15d5c53ec0aae9b033" + "sha": "6946fd71ae9215b0e7ae188f5057df765ee6d7d2" } } ], @@ -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-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java", "google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java", + "google-cloud-functions/src/main/java/com/google/cloud/functions/v1/gapic_metadata.json", "google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java", "google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java", "google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java", diff --git a/versions.txt b/versions.txt index f74ffc48..3d478752 100644 --- a/versions.txt +++ b/versions.txt @@ -1,6 +1,6 @@ # Format: # module:released-version:current-version -google-cloud-functions:1.0.6:1.0.6 -proto-google-cloud-functions-v1:1.0.6:1.0.6 -grpc-google-cloud-functions-v1:1.0.6:1.0.6 +google-cloud-functions:1.0.7:1.0.7 +proto-google-cloud-functions-v1:1.0.7:1.0.7 +grpc-google-cloud-functions-v1:1.0.7:1.0.7