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

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

+ * 
+ * try (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(). + * + *

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

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

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

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

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

To customize credentials: + * + *

+ * 
+ * CloudFunctionsServiceSettings cloudFunctionsServiceSettings =
+ *     CloudFunctionsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudFunctionsServiceClient cloudFunctionsServiceClient =
+ *     CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * CloudFunctionsServiceSettings cloudFunctionsServiceSettings =
+ *     CloudFunctionsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudFunctionsServiceClient cloudFunctionsServiceClient =
+ *     CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudFunctionsServiceClient implements BackgroundResource { + private final CloudFunctionsServiceSettings settings; + private final CloudFunctionsServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CloudFunctionsServiceClient with default settings. */ + public static final CloudFunctionsServiceClient create() throws IOException { + return create(CloudFunctionsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudFunctionsServiceClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final CloudFunctionsServiceClient create(CloudFunctionsServiceSettings settings) + throws IOException { + return new CloudFunctionsServiceClient(settings); + } + + /** + * Constructs an instance of CloudFunctionsServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer to use CloudFunctionsServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub stub) { + return new CloudFunctionsServiceClient(stub); + } + + /** + * Constructs an instance of CloudFunctionsServiceClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected CloudFunctionsServiceClient(CloudFunctionsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudFunctionsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CloudFunctionsServiceClient(CloudFunctionsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CloudFunctionsServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudFunctionsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ListFunctionsRequest request = ListFunctionsRequest.newBuilder().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 + */ + public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest request) { + return listFunctionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ListFunctionsRequest request = ListFunctionsRequest.newBuilder().build();
+   *   ApiFuture<ListFunctionsPagedResponse> future = cloudFunctionsServiceClient.listFunctionsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (CloudFunction element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listFunctionsPagedCallable() { + return stub.listFunctionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ListFunctionsRequest request = ListFunctionsRequest.newBuilder().build();
+   *   while (true) {
+   *     ListFunctionsResponse response = cloudFunctionsServiceClient.listFunctionsCallable().call(request);
+   *     for (CloudFunction element : response.getFunctionsList()) {
+   *       // 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a function with the given name from the requested project. + * + *

Sample 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 + */ + public final CloudFunction getFunction(CloudFunctionName name) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *


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

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   GetFunctionRequest request = GetFunctionRequest.newBuilder()
+   *     .setName(name.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 + */ + public final CloudFunction getFunction(GetFunctionRequest request) { + return getFunctionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   GetFunctionRequest request = GetFunctionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<CloudFunction> future = cloudFunctionsServiceClient.getFunctionCallable().futureCall(request);
+   *   // Do something
+   *   CloudFunction response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getFunctionCallable() { + return stub.getFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * 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. + * @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 createFunctionAsync( + LocationName location, CloudFunction function) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setLocation(location == null ? null : location.toString()) + .setFunction(function) + .build(); + return createFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CloudFunction response = cloudFunctionsServiceClient.createFunctionAsync(location.toString(), 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. + * @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 createFunctionAsync( + String location, CloudFunction function) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder().setLocation(location).setFunction(function).build(); + return createFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CreateFunctionRequest request = CreateFunctionRequest.newBuilder()
+   *     .setLocation(location.toString())
+   *     .setFunction(function)
+   *     .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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createFunctionAsync( + CreateFunctionRequest request) { + return createFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CreateFunctionRequest request = CreateFunctionRequest.newBuilder()
+   *     .setLocation(location.toString())
+   *     .setFunction(function)
+   *     .build();
+   *   OperationFuture<CloudFunction, OperationMetadataV1> future = cloudFunctionsServiceClient.createFunctionOperationCallable().futureCall(request);
+   *   // Do something
+   *   CloudFunction response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createFunctionOperationCallable() { + return stub.createFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   LocationName location = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CloudFunction function = CloudFunction.newBuilder().build();
+   *   CreateFunctionRequest request = CreateFunctionRequest.newBuilder()
+   *     .setLocation(location.toString())
+   *     .setFunction(function)
+   *     .build();
+   *   ApiFuture<Operation> future = cloudFunctionsServiceClient.createFunctionCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createFunctionCallable() { + return stub.createFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates existing function. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateFunctionAsync( + CloudFunctionName function) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(function == null ? null : function.toString()) + .build(); + return updateFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates existing function. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   CloudFunction response = cloudFunctionsServiceClient.updateFunctionAsync(function.toString()).get();
+   * }
+   * 
+ * + * @param function Required. New version of the function. + * @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 updateFunctionAsync( + CloudFunction function) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder().setFunction(function).build(); + return updateFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates existing function. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   UpdateFunctionRequest request = UpdateFunctionRequest.newBuilder()
+   *     .setFunction(function.toString())
+   *     .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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateFunctionAsync( + UpdateFunctionRequest request) { + return updateFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates existing function. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   UpdateFunctionRequest request = UpdateFunctionRequest.newBuilder()
+   *     .setFunction(function.toString())
+   *     .build();
+   *   OperationFuture<CloudFunction, OperationMetadataV1> future = cloudFunctionsServiceClient.updateFunctionOperationCallable().futureCall(request);
+   *   // Do something
+   *   CloudFunction response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateFunctionOperationCallable() { + return stub.updateFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates existing function. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   UpdateFunctionRequest request = UpdateFunctionRequest.newBuilder()
+   *     .setFunction(function.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = cloudFunctionsServiceClient.updateFunctionCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateFunctionCallable() { + return stub.updateFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * 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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteFunctionAsync( + CloudFunctionName name) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   cloudFunctionsServiceClient.deleteFunctionAsync(name.toString()).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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteFunctionAsync(String name) { + DeleteFunctionRequest request = DeleteFunctionRequest.newBuilder().setName(name).build(); + return deleteFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   DeleteFunctionRequest request = DeleteFunctionRequest.newBuilder()
+   *     .setName(name.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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteFunctionAsync( + DeleteFunctionRequest request) { + return deleteFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   DeleteFunctionRequest request = DeleteFunctionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Empty, OperationMetadataV1> future = cloudFunctionsServiceClient.deleteFunctionOperationCallable().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 + deleteFunctionOperationCallable() { + return stub.deleteFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   DeleteFunctionRequest request = DeleteFunctionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = cloudFunctionsServiceClient.deleteFunctionCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteFunctionCallable() { + return stub.deleteFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   String data = "";
+   *   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 + */ + public final CallFunctionResponse callFunction(CloudFunctionName name, String data) { + CallFunctionRequest request = + CallFunctionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setData(data) + .build(); + return callFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   String data = "";
+   *   CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(name.toString(), 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 + */ + public final CallFunctionResponse callFunction(String name, String data) { + CallFunctionRequest request = + CallFunctionRequest.newBuilder().setName(name).setData(data).build(); + return callFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   String data = "";
+   *   CallFunctionRequest request = CallFunctionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setData(data)
+   *     .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 + */ + public final CallFunctionResponse callFunction(CallFunctionRequest request) { + return callFunctionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Synchronously invokes a deployed Cloud Function. To be used for testing purposes as very + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   String data = "";
+   *   CallFunctionRequest request = CallFunctionRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setData(data)
+   *     .build();
+   *   ApiFuture<CallFunctionResponse> future = cloudFunctionsServiceClient.callFunctionCallable().futureCall(request);
+   *   // Do something
+   *   CallFunctionResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable callFunctionCallable() { + return stub.callFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a signed URL for uploading a function source code. For more information about the + * signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should be provided in + * CreateFunction or UpdateFunction request as a reference to the function source code. + * + *

When uploading source code to the generated signed URL, please follow these restrictions: + * + *

* Source file type should be a zip file. * Source file size should not exceed 100MB + * limit. * No credentials should be attached - the signed URLs provide access to the target + * bucket using internal service identity; if credentials were attached, the identity from the + * credentials would be used, but that identity does not have permissions to upload files to the + * URL. + * + *

When making a HTTP PUT request, these two headers need to be specified: + * + *

* `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` + * + *

And this header SHOULD NOT be specified: + * + *

* `Authorization: Bearer YOUR_TOKEN` + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder().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 + */ + public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlRequest request) { + return generateUploadUrlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a signed URL for uploading a function source code. For more information about the + * signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should be provided in + * CreateFunction or UpdateFunction request as a reference to the function source code. + * + *

When uploading source code to the generated signed URL, please follow these restrictions: + * + *

* Source file type should be a zip file. * Source file size should not exceed 100MB + * limit. * No credentials should be attached - the signed URLs provide access to the target + * bucket using internal service identity; if credentials were attached, the identity from the + * credentials would be used, but that identity does not have permissions to upload files to the + * URL. + * + *

When making a HTTP PUT request, these two headers need to be specified: + * + *

* `content-type: application/zip` * `x-goog-content-length-range: 0,104857600` + * + *

And this header SHOULD NOT be specified: + * + *

* `Authorization: Bearer YOUR_TOKEN` + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder().build();
+   *   ApiFuture<GenerateUploadUrlResponse> future = cloudFunctionsServiceClient.generateUploadUrlCallable().futureCall(request);
+   *   // Do something
+   *   GenerateUploadUrlResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + generateUploadUrlCallable() { + return stub.generateUploadUrlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a signed URL for downloading deployed function source code. The URL is only valid for a + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   GenerateDownloadUrlRequest request = GenerateDownloadUrlRequest.newBuilder().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 + */ + public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrlRequest request) { + return generateDownloadUrlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns a signed URL for downloading deployed function source code. The URL is only valid for a + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   GenerateDownloadUrlRequest request = GenerateDownloadUrlRequest.newBuilder().build();
+   *   ApiFuture<GenerateDownloadUrlResponse> future = cloudFunctionsServiceClient.generateDownloadUrlCallable().futureCall(request);
+   *   // Do something
+   *   GenerateDownloadUrlResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + generateDownloadUrlCallable() { + return stub.generateDownloadUrlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the IAM access control policy on the specified function. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .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 + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the IAM access control policy on the specified function. Replaces any existing policy. + * + *

Sample code: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = cloudFunctionsServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .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 + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = cloudFunctionsServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .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 + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+   *   ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = cloudFunctionsServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListFunctionsPagedResponse + extends AbstractPagedListResponse< + ListFunctionsRequest, + ListFunctionsResponse, + CloudFunction, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFunctionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFunctionsPagedResponse apply(ListFunctionsPage input) { + return new ListFunctionsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFunctionsPagedResponse(ListFunctionsPage page) { + super(page, ListFunctionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFunctionsPage + extends AbstractPage< + ListFunctionsRequest, ListFunctionsResponse, CloudFunction, ListFunctionsPage> { + + private ListFunctionsPage( + PageContext context, + ListFunctionsResponse response) { + super(context, response); + } + + private static ListFunctionsPage createEmptyPage() { + return new ListFunctionsPage(null, null); + } + + @Override + protected ListFunctionsPage createPage( + PageContext context, + ListFunctionsResponse response) { + return new ListFunctionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFunctionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFunctionsRequest, + ListFunctionsResponse, + CloudFunction, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + private ListFunctionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFunctionsFixedSizeCollection createEmptyCollection() { + return new ListFunctionsFixedSizeCollection(null, 0); + } + + @Override + protected ListFunctionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFunctionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java new file mode 100644 index 00000000..39892158 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java @@ -0,0 +1,353 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1; + +import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.functions.v1.stub.CloudFunctionsServiceStubSettings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link CloudFunctionsServiceClient}. + * + *

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

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

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

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

+ * 
+ * CloudFunctionsServiceSettings.Builder cloudFunctionsServiceSettingsBuilder =
+ *     CloudFunctionsServiceSettings.newBuilder();
+ * cloudFunctionsServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         cloudFunctionsServiceSettingsBuilder.getFunctionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudFunctionsServiceSettings cloudFunctionsServiceSettings = cloudFunctionsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudFunctionsServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).listFunctionsSettings(); + } + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).getFunctionSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).createFunctionSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createFunctionOperationSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()) + .createFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).updateFunctionSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateFunctionOperationSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()) + .updateFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).deleteFunctionSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteFunctionOperationSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()) + .deleteFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to callFunction. */ + public UnaryCallSettings callFunctionSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).callFunctionSettings(); + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).generateUploadUrlSettings(); + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).generateDownloadUrlSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((CloudFunctionsServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final CloudFunctionsServiceSettings create(CloudFunctionsServiceStubSettings stub) + throws IOException { + return new CloudFunctionsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudFunctionsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudFunctionsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudFunctionsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudFunctionsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudFunctionsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudFunctionsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudFunctionsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudFunctionsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudFunctionsServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(CloudFunctionsServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(CloudFunctionsServiceStubSettings.newBuilder()); + } + + protected Builder(CloudFunctionsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudFunctionsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public CloudFunctionsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((CloudFunctionsServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return getStubSettingsBuilder().listFunctionsSettings(); + } + + /** Returns the builder for the settings used for calls to getFunction. */ + public UnaryCallSettings.Builder getFunctionSettings() { + return getStubSettingsBuilder().getFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public UnaryCallSettings.Builder createFunctionSettings() { + return getStubSettingsBuilder().createFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to createFunction. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createFunctionOperationSettings() { + return getStubSettingsBuilder().createFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public UnaryCallSettings.Builder updateFunctionSettings() { + return getStubSettingsBuilder().updateFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateFunctionOperationSettings() { + return getStubSettingsBuilder().updateFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public UnaryCallSettings.Builder deleteFunctionSettings() { + return getStubSettingsBuilder().deleteFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return getStubSettingsBuilder().deleteFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to callFunction. */ + public UnaryCallSettings.Builder + callFunctionSettings() { + return getStubSettingsBuilder().callFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings.Builder + generateUploadUrlSettings() { + return getStubSettingsBuilder().generateUploadUrlSettings(); + } + + /** Returns the builder for the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings.Builder + generateDownloadUrlSettings() { + return getStubSettingsBuilder().generateDownloadUrlSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public CloudFunctionsServiceSettings build() throws IOException { + return new CloudFunctionsServiceSettings(this); + } + } +} 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 new file mode 100644 index 00000000..a99e00a5 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java @@ -0,0 +1,40 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Functions API. + * + *

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

=========================== CloudFunctionsServiceClient =========================== + * + *

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

Sample for CloudFunctionsServiceClient: + * + *

+ * 
+ * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = CloudFunctionsServiceClient.create()) {
+ *   CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+ *   CloudFunction response = cloudFunctionsServiceClient.getFunction(name);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.functions.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java new file mode 100644 index 00000000..68272c3c --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1.stub; + +import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v1.CallFunctionRequest; +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CreateFunctionRequest; +import com.google.cloud.functions.v1.DeleteFunctionRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v1.GenerateUploadUrlRequest; +import com.google.cloud.functions.v1.GenerateUploadUrlResponse; +import com.google.cloud.functions.v1.GetFunctionRequest; +import com.google.cloud.functions.v1.ListFunctionsRequest; +import com.google.cloud.functions.v1.ListFunctionsResponse; +import com.google.cloud.functions.v1.OperationMetadataV1; +import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Functions API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class CloudFunctionsServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listFunctionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsPagedCallable()"); + } + + public UnaryCallable listFunctionsCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsCallable()"); + } + + public UnaryCallable getFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: getFunctionCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionOperationCallable()"); + } + + public UnaryCallable createFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionOperationCallable()"); + } + + public UnaryCallable updateFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionOperationCallable()"); + } + + public UnaryCallable deleteFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionCallable()"); + } + + public UnaryCallable callFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: callFunctionCallable()"); + } + + public UnaryCallable + generateUploadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateUploadUrlCallable()"); + } + + public UnaryCallable + generateDownloadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateDownloadUrlCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java new file mode 100644 index 00000000..59ac3e98 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java @@ -0,0 +1,767 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1.stub; + +import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v1.CallFunctionRequest; +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CreateFunctionRequest; +import com.google.cloud.functions.v1.DeleteFunctionRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v1.GenerateUploadUrlRequest; +import com.google.cloud.functions.v1.GenerateUploadUrlResponse; +import com.google.cloud.functions.v1.GetFunctionRequest; +import com.google.cloud.functions.v1.ListFunctionsRequest; +import com.google.cloud.functions.v1.ListFunctionsResponse; +import com.google.cloud.functions.v1.OperationMetadataV1; +import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link CloudFunctionsServiceStub}. + * + *

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

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

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

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

+ * 
+ * CloudFunctionsServiceStubSettings.Builder cloudFunctionsServiceSettingsBuilder =
+ *     CloudFunctionsServiceStubSettings.newBuilder();
+ * cloudFunctionsServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         cloudFunctionsServiceSettingsBuilder.getFunctionSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudFunctionsServiceStubSettings cloudFunctionsServiceSettings = cloudFunctionsServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudFunctionsServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings getFunctionSettings; + private final UnaryCallSettings createFunctionSettings; + private final OperationCallSettings + createFunctionOperationSettings; + private final UnaryCallSettings updateFunctionSettings; + private final OperationCallSettings + updateFunctionOperationSettings; + private final UnaryCallSettings deleteFunctionSettings; + private final OperationCallSettings + deleteFunctionOperationSettings; + private final UnaryCallSettings callFunctionSettings; + private final UnaryCallSettings + generateUploadUrlSettings; + private final UnaryCallSettings + generateDownloadUrlSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return getFunctionSettings; + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return createFunctionSettings; + } + + /** Returns the object with the settings used for calls to createFunction. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createFunctionOperationSettings() { + return createFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return updateFunctionSettings; + } + + /** Returns the object with the settings used for calls to updateFunction. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateFunctionOperationSettings() { + return updateFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return deleteFunctionSettings; + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to callFunction. */ + public UnaryCallSettings callFunctionSettings() { + return callFunctionSettings; + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return generateUploadUrlSettings; + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return generateDownloadUrlSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudFunctionsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudFunctionsServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudfunctions.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudFunctionsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudFunctionsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listFunctionsSettings = settingsBuilder.listFunctionsSettings().build(); + getFunctionSettings = settingsBuilder.getFunctionSettings().build(); + createFunctionSettings = settingsBuilder.createFunctionSettings().build(); + createFunctionOperationSettings = settingsBuilder.createFunctionOperationSettings().build(); + updateFunctionSettings = settingsBuilder.updateFunctionSettings().build(); + updateFunctionOperationSettings = settingsBuilder.updateFunctionOperationSettings().build(); + deleteFunctionSettings = settingsBuilder.deleteFunctionSettings().build(); + deleteFunctionOperationSettings = settingsBuilder.deleteFunctionOperationSettings().build(); + callFunctionSettings = settingsBuilder.callFunctionSettings().build(); + generateUploadUrlSettings = settingsBuilder.generateUploadUrlSettings().build(); + generateDownloadUrlSettings = settingsBuilder.generateDownloadUrlSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + private static final PagedListDescriptor< + ListFunctionsRequest, ListFunctionsResponse, CloudFunction> + LIST_FUNCTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFunctionsRequest injectToken(ListFunctionsRequest payload, String token) { + return ListFunctionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFunctionsRequest injectPageSize(ListFunctionsRequest payload, int pageSize) { + return ListFunctionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFunctionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFunctionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFunctionsResponse payload) { + return payload.getFunctionsList() != null + ? payload.getFunctionsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + LIST_FUNCTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFunctionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FUNCTIONS_PAGE_STR_DESC, request, context); + return ListFunctionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for CloudFunctionsServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings.Builder getFunctionSettings; + private final UnaryCallSettings.Builder + createFunctionSettings; + private final OperationCallSettings.Builder< + CreateFunctionRequest, CloudFunction, OperationMetadataV1> + createFunctionOperationSettings; + private final UnaryCallSettings.Builder + updateFunctionSettings; + private final OperationCallSettings.Builder< + UpdateFunctionRequest, CloudFunction, OperationMetadataV1> + updateFunctionOperationSettings; + private final UnaryCallSettings.Builder + deleteFunctionSettings; + private final OperationCallSettings.Builder + deleteFunctionOperationSettings; + private final UnaryCallSettings.Builder + callFunctionSettings; + private final UnaryCallSettings.Builder + generateUploadUrlSettings; + private final UnaryCallSettings.Builder + generateDownloadUrlSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listFunctionsSettings = PagedCallSettings.newBuilder(LIST_FUNCTIONS_PAGE_STR_FACT); + + getFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createFunctionOperationSettings = OperationCallSettings.newBuilder(); + + updateFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateFunctionOperationSettings = OperationCallSettings.newBuilder(); + + deleteFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteFunctionOperationSettings = OperationCallSettings.newBuilder(); + + callFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + generateUploadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + generateDownloadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listFunctionsSettings, + getFunctionSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + callFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listFunctionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .callFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateUploadUrlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateDownloadUrlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .createFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(CloudFunction.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadataV1.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .updateFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(CloudFunction.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadataV1.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder + .deleteFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadataV1.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(CloudFunctionsServiceStubSettings settings) { + super(settings); + + listFunctionsSettings = settings.listFunctionsSettings.toBuilder(); + getFunctionSettings = settings.getFunctionSettings.toBuilder(); + createFunctionSettings = settings.createFunctionSettings.toBuilder(); + createFunctionOperationSettings = settings.createFunctionOperationSettings.toBuilder(); + updateFunctionSettings = settings.updateFunctionSettings.toBuilder(); + updateFunctionOperationSettings = settings.updateFunctionOperationSettings.toBuilder(); + deleteFunctionSettings = settings.deleteFunctionSettings.toBuilder(); + deleteFunctionOperationSettings = settings.deleteFunctionOperationSettings.toBuilder(); + callFunctionSettings = settings.callFunctionSettings.toBuilder(); + generateUploadUrlSettings = settings.generateUploadUrlSettings.toBuilder(); + generateDownloadUrlSettings = settings.generateDownloadUrlSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listFunctionsSettings, + getFunctionSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + callFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** Returns the builder for the settings used for calls to getFunction. */ + public UnaryCallSettings.Builder getFunctionSettings() { + return getFunctionSettings; + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public UnaryCallSettings.Builder createFunctionSettings() { + return createFunctionSettings; + } + + /** Returns the builder for the settings used for calls to createFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createFunctionOperationSettings() { + return createFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public UnaryCallSettings.Builder updateFunctionSettings() { + return updateFunctionSettings; + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateFunctionOperationSettings() { + return updateFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public UnaryCallSettings.Builder deleteFunctionSettings() { + return deleteFunctionSettings; + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to callFunction. */ + public UnaryCallSettings.Builder + callFunctionSettings() { + return callFunctionSettings; + } + + /** Returns the builder for the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings.Builder + generateUploadUrlSettings() { + return generateUploadUrlSettings; + } + + /** Returns the builder for the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings.Builder + generateDownloadUrlSettings() { + return generateDownloadUrlSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public CloudFunctionsServiceStubSettings build() throws IOException { + return new CloudFunctionsServiceStubSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceCallableFactory.java new file mode 100644 index 00000000..3fa668d3 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Functions API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcCloudFunctionsServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-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 new file mode 100644 index 00000000..fa80c329 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/GrpcCloudFunctionsServiceStub.java @@ -0,0 +1,554 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1.stub; + +import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v1.CallFunctionRequest; +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CreateFunctionRequest; +import com.google.cloud.functions.v1.DeleteFunctionRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v1.GenerateUploadUrlRequest; +import com.google.cloud.functions.v1.GenerateUploadUrlResponse; +import com.google.cloud.functions.v1.GetFunctionRequest; +import com.google.cloud.functions.v1.ListFunctionsRequest; +import com.google.cloud.functions.v1.ListFunctionsResponse; +import com.google.cloud.functions.v1.OperationMetadataV1; +import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Functions API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcCloudFunctionsServiceStub extends CloudFunctionsServiceStub { + + private static final MethodDescriptor + listFunctionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/ListFunctions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListFunctionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFunctionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/GetFunction") + .setRequestMarshaller(ProtoUtils.marshaller(GetFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CloudFunction.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/CreateFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/UpdateFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/DeleteFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + callFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/CallFunction") + .setRequestMarshaller(ProtoUtils.marshaller(CallFunctionRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(CallFunctionResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + generateUploadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.functions.v1.CloudFunctionsService/GenerateUploadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateUploadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateUploadUrlResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + generateDownloadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.functions.v1.CloudFunctionsService/GenerateDownloadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.functions.v1.CloudFunctionsService/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + private final UnaryCallable getFunctionCallable; + private final UnaryCallable createFunctionCallable; + private final OperationCallable + createFunctionOperationCallable; + private final UnaryCallable updateFunctionCallable; + private final OperationCallable + updateFunctionOperationCallable; + private final UnaryCallable deleteFunctionCallable; + private final OperationCallable + deleteFunctionOperationCallable; + private final UnaryCallable callFunctionCallable; + private final UnaryCallable + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudFunctionsServiceStub create( + CloudFunctionsServiceStubSettings settings) throws IOException { + return new GrpcCloudFunctionsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudFunctionsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudFunctionsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudFunctionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudFunctionsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudFunctionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listFunctionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListFunctionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetFunctionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings createFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateFunctionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("location", String.valueOf(request.getLocation())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateFunctionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("function.name", String.valueOf(request.getFunction().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteFunctionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings callFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(callFunctionMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CallFunctionRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + generateUploadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GenerateUploadUrlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + generateDownloadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GenerateDownloadUrlRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + this.operationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + this.operationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + this.operationsStub); + this.callFunctionCallable = + callableFactory.createUnaryCallable( + callFunctionTransportSettings, settings.callFunctionSettings(), clientContext); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + public UnaryCallable callFunctionCallable() { + return callFunctionCallable; + } + + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-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 new file mode 100644 index 00000000..d11a48e5 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java @@ -0,0 +1,670 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1; + +import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.resourcenames.ResourceName; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class CloudFunctionsServiceClientTest { + private static MockCloudFunctionsService mockCloudFunctionsService; + private static MockServiceHelper serviceHelper; + private CloudFunctionsServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCloudFunctionsService = new MockCloudFunctionsService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudFunctionsService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + CloudFunctionsServiceSettings settings = + CloudFunctionsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudFunctionsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listFunctionsTest() { + String nextPageToken = ""; + CloudFunction functionsElement = CloudFunction.newBuilder().build(); + List functions = Arrays.asList(functionsElement); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllFunctions(functions) + .build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + ListFunctionsRequest request = ListFunctionsRequest.newBuilder().build(); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = (ListFunctionsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listFunctionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + ListFunctionsRequest request = ListFunctionsRequest.newBuilder().build(); + + client.listFunctions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getFunctionTest() { + CloudFunctionName name2 = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String description = "description-1724546052"; + String sourceArchiveUrl = "sourceArchiveUrl-289007026"; + String entryPoint = "entryPoint-799136893"; + String runtime = "runtime1550962648"; + int availableMemoryMb = 1964533661; + String serviceAccountEmail = "serviceAccountEmail-1300473088"; + long versionId = 670497310L; + String network = "network1843485230"; + int maxInstances = 330682013; + String vpcConnector = "vpcConnector1732864119"; + String buildId = "buildId-1430655860"; + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(name2.toString()) + .setDescription(description) + .setSourceArchiveUrl(sourceArchiveUrl) + .setEntryPoint(entryPoint) + .setRuntime(runtime) + .setAvailableMemoryMb(availableMemoryMb) + .setServiceAccountEmail(serviceAccountEmail) + .setVersionId(versionId) + .setNetwork(network) + .setMaxInstances(maxInstances) + .setVpcConnector(vpcConnector) + .setBuildId(buildId) + .build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + CloudFunction actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = (GetFunctionRequest) actualRequests.get(0); + + Assert.assertEquals(name, CloudFunctionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createFunctionTest() throws Exception { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String description = "description-1724546052"; + String sourceArchiveUrl = "sourceArchiveUrl-289007026"; + String entryPoint = "entryPoint-799136893"; + String runtime = "runtime1550962648"; + int availableMemoryMb = 1964533661; + String serviceAccountEmail = "serviceAccountEmail-1300473088"; + long versionId = 670497310L; + String network = "network1843485230"; + int maxInstances = 330682013; + String vpcConnector = "vpcConnector1732864119"; + String buildId = "buildId-1430655860"; + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setSourceArchiveUrl(sourceArchiveUrl) + .setEntryPoint(entryPoint) + .setRuntime(runtime) + .setAvailableMemoryMb(availableMemoryMb) + .setServiceAccountEmail(serviceAccountEmail) + .setVersionId(versionId) + .setNetwork(network) + .setMaxInstances(maxInstances) + .setVpcConnector(vpcConnector) + .setBuildId(buildId) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFunctionsService.addResponse(resultOperation); + + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + CloudFunction function = CloudFunction.newBuilder().build(); + + CloudFunction actualResponse = client.createFunctionAsync(location, function).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = (CreateFunctionRequest) actualRequests.get(0); + + Assert.assertEquals(location, LocationName.parse(actualRequest.getLocation())); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + CloudFunction function = CloudFunction.newBuilder().build(); + + client.createFunctionAsync(location, function).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateFunctionTest() throws Exception { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String description = "description-1724546052"; + String sourceArchiveUrl = "sourceArchiveUrl-289007026"; + String entryPoint = "entryPoint-799136893"; + String runtime = "runtime1550962648"; + int availableMemoryMb = 1964533661; + String serviceAccountEmail = "serviceAccountEmail-1300473088"; + long versionId = 670497310L; + String network = "network1843485230"; + int maxInstances = 330682013; + String vpcConnector = "vpcConnector1732864119"; + String buildId = "buildId-1430655860"; + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(name.toString()) + .setDescription(description) + .setSourceArchiveUrl(sourceArchiveUrl) + .setEntryPoint(entryPoint) + .setRuntime(runtime) + .setAvailableMemoryMb(availableMemoryMb) + .setServiceAccountEmail(serviceAccountEmail) + .setVersionId(versionId) + .setNetwork(network) + .setMaxInstances(maxInstances) + .setVpcConnector(vpcConnector) + .setBuildId(buildId) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFunctionsService.addResponse(resultOperation); + + CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + CloudFunction actualResponse = client.updateFunctionAsync(function).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFunctionRequest actualRequest = (UpdateFunctionRequest) actualRequests.get(0); + + Assert.assertEquals(function, CloudFunctionName.parse(actualRequest.getFunction())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + CloudFunctionName function = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.updateFunctionAsync(function).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudFunctionsService.addResponse(resultOperation); + + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Empty actualResponse = client.deleteFunctionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = (DeleteFunctionRequest) actualRequests.get(0); + + Assert.assertEquals(name, CloudFunctionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void callFunctionTest() { + String executionId = "executionId-1217171550"; + String result = "result-934426595"; + String error = "error96784904"; + CallFunctionResponse expectedResponse = + CallFunctionResponse.newBuilder() + .setExecutionId(executionId) + .setResult(result) + .setError(error) + .build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String data = "data3076010"; + + CallFunctionResponse actualResponse = client.callFunction(name, data); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CallFunctionRequest actualRequest = (CallFunctionRequest) actualRequests.get(0); + + Assert.assertEquals(name, CloudFunctionName.parse(actualRequest.getName())); + Assert.assertEquals(data, actualRequest.getData()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void callFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String data = "data3076010"; + + client.callFunction(name, data); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void generateUploadUrlTest() { + String uploadUrl = "uploadUrl-242738639"; + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder().setUploadUrl(uploadUrl).build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder().build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateUploadUrlRequest actualRequest = (GenerateUploadUrlRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void generateUploadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder().build(); + + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void generateDownloadUrlTest() { + String downloadUrl = "downloadUrl1109408056"; + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl(downloadUrl).build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = GenerateDownloadUrlRequest.newBuilder().build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateDownloadUrlRequest actualRequest = (GenerateDownloadUrlRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void generateDownloadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + GenerateDownloadUrlRequest request = GenerateDownloadUrlRequest.newBuilder().build(); + + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + Policy policy = Policy.newBuilder().build(); + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource.toString()).setPolicy(policy).build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + Policy policy = Policy.newBuilder().build(); + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource.toString()) + .setPolicy(policy) + .build(); + + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build(); + + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockCloudFunctionsService.addResponse(expectedResponse); + + ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + List permissions = new ArrayList<>(); + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource.toString()) + .addAllPermissions(permissions) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudFunctionsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudFunctionsService.addException(exception); + + try { + ResourceName resource = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + List permissions = new ArrayList<>(); + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource.toString()) + .addAllPermissions(permissions) + .build(); + + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsService.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsService.java new file mode 100644 index 00000000..d6a08c36 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCloudFunctionsService implements MockGrpcService { + private final MockCloudFunctionsServiceImpl serviceImpl; + + public MockCloudFunctionsService() { + serviceImpl = new MockCloudFunctionsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-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 new file mode 100644 index 00000000..8644c3e6 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockCloudFunctionsServiceImpl.java @@ -0,0 +1,230 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.functions.v1.CloudFunctionsServiceGrpc.CloudFunctionsServiceImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCloudFunctionsServiceImpl extends CloudFunctionsServiceImplBase { + private List requests; + private Queue responses; + + public MockCloudFunctionsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listFunctions( + ListFunctionsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFunctionsResponse) { + requests.add(request); + responseObserver.onNext((ListFunctionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getFunction( + GetFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CloudFunction) { + requests.add(request); + responseObserver.onNext((CloudFunction) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createFunction( + CreateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateFunction( + UpdateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteFunction( + DeleteFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void callFunction( + CallFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof CallFunctionResponse) { + requests.add(request); + responseObserver.onNext((CallFunctionResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void generateUploadUrl( + GenerateUploadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GenerateUploadUrlResponse) { + requests.add(request); + responseObserver.onNext((GenerateUploadUrlResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void generateDownloadUrl( + GenerateDownloadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof GenerateDownloadUrlResponse) { + requests.add(request); + responseObserver.onNext((GenerateDownloadUrlResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-functions-v1/pom.xml b/grpc-google-cloud-functions-v1/pom.xml new file mode 100644 index 00000000..f255ebad --- /dev/null +++ b/grpc-google-cloud-functions-v1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-functions-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-functions-v1 + GRPC library for grpc-google-cloud-functions-v1 + + com.google.cloud + google-cloud-functions-parent + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-functions-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceGrpc.java b/grpc-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceGrpc.java new file mode 100644 index 00000000..82b16a58 --- /dev/null +++ b/grpc-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceGrpc.java @@ -0,0 +1,1646 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * A service that application uses to manipulate triggers and functions.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/functions/v1/functions.proto") +public final class CloudFunctionsServiceGrpc { + + private CloudFunctionsServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.functions.v1.CloudFunctionsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.ListFunctionsRequest, + com.google.cloud.functions.v1.ListFunctionsResponse> + getListFunctionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFunctions", + requestType = com.google.cloud.functions.v1.ListFunctionsRequest.class, + responseType = com.google.cloud.functions.v1.ListFunctionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.ListFunctionsRequest, + com.google.cloud.functions.v1.ListFunctionsResponse> + getListFunctionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.ListFunctionsRequest, + com.google.cloud.functions.v1.ListFunctionsResponse> + getListFunctionsMethod; + if ((getListFunctionsMethod = CloudFunctionsServiceGrpc.getListFunctionsMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getListFunctionsMethod = CloudFunctionsServiceGrpc.getListFunctionsMethod) == null) { + CloudFunctionsServiceGrpc.getListFunctionsMethod = + getListFunctionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFunctions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.ListFunctionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.ListFunctionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("ListFunctions")) + .build(); + } + } + } + return getListFunctionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GetFunctionRequest, + com.google.cloud.functions.v1.CloudFunction> + getGetFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFunction", + requestType = com.google.cloud.functions.v1.GetFunctionRequest.class, + responseType = com.google.cloud.functions.v1.CloudFunction.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GetFunctionRequest, + com.google.cloud.functions.v1.CloudFunction> + getGetFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GetFunctionRequest, + com.google.cloud.functions.v1.CloudFunction> + getGetFunctionMethod; + if ((getGetFunctionMethod = CloudFunctionsServiceGrpc.getGetFunctionMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getGetFunctionMethod = CloudFunctionsServiceGrpc.getGetFunctionMethod) == null) { + CloudFunctionsServiceGrpc.getGetFunctionMethod = + getGetFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.GetFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.CloudFunction.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("GetFunction")) + .build(); + } + } + } + return getGetFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFunction", + requestType = com.google.cloud.functions.v1.CreateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod; + if ((getCreateFunctionMethod = CloudFunctionsServiceGrpc.getCreateFunctionMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getCreateFunctionMethod = CloudFunctionsServiceGrpc.getCreateFunctionMethod) == null) { + CloudFunctionsServiceGrpc.getCreateFunctionMethod = + getCreateFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.CreateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("CreateFunction")) + .build(); + } + } + } + return getCreateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateFunction", + requestType = com.google.cloud.functions.v1.UpdateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod; + if ((getUpdateFunctionMethod = CloudFunctionsServiceGrpc.getUpdateFunctionMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getUpdateFunctionMethod = CloudFunctionsServiceGrpc.getUpdateFunctionMethod) == null) { + CloudFunctionsServiceGrpc.getUpdateFunctionMethod = + getUpdateFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.UpdateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("UpdateFunction")) + .build(); + } + } + } + return getUpdateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFunction", + requestType = com.google.cloud.functions.v1.DeleteFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod; + if ((getDeleteFunctionMethod = CloudFunctionsServiceGrpc.getDeleteFunctionMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getDeleteFunctionMethod = CloudFunctionsServiceGrpc.getDeleteFunctionMethod) == null) { + CloudFunctionsServiceGrpc.getDeleteFunctionMethod = + getDeleteFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.DeleteFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("DeleteFunction")) + .build(); + } + } + } + return getDeleteFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.CallFunctionRequest, + com.google.cloud.functions.v1.CallFunctionResponse> + getCallFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CallFunction", + requestType = com.google.cloud.functions.v1.CallFunctionRequest.class, + responseType = com.google.cloud.functions.v1.CallFunctionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.CallFunctionRequest, + com.google.cloud.functions.v1.CallFunctionResponse> + getCallFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.CallFunctionRequest, + com.google.cloud.functions.v1.CallFunctionResponse> + getCallFunctionMethod; + if ((getCallFunctionMethod = CloudFunctionsServiceGrpc.getCallFunctionMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getCallFunctionMethod = CloudFunctionsServiceGrpc.getCallFunctionMethod) == null) { + CloudFunctionsServiceGrpc.getCallFunctionMethod = + getCallFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CallFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.CallFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.CallFunctionResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("CallFunction")) + .build(); + } + } + } + return getCallFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GenerateUploadUrlRequest, + com.google.cloud.functions.v1.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateUploadUrl", + requestType = com.google.cloud.functions.v1.GenerateUploadUrlRequest.class, + responseType = com.google.cloud.functions.v1.GenerateUploadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GenerateUploadUrlRequest, + com.google.cloud.functions.v1.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GenerateUploadUrlRequest, + com.google.cloud.functions.v1.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + if ((getGenerateUploadUrlMethod = CloudFunctionsServiceGrpc.getGenerateUploadUrlMethod) + == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getGenerateUploadUrlMethod = CloudFunctionsServiceGrpc.getGenerateUploadUrlMethod) + == null) { + CloudFunctionsServiceGrpc.getGenerateUploadUrlMethod = + getGenerateUploadUrlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GenerateUploadUrl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.GenerateUploadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.GenerateUploadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("GenerateUploadUrl")) + .build(); + } + } + } + return getGenerateUploadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GenerateDownloadUrlRequest, + com.google.cloud.functions.v1.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateDownloadUrl", + requestType = com.google.cloud.functions.v1.GenerateDownloadUrlRequest.class, + responseType = com.google.cloud.functions.v1.GenerateDownloadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GenerateDownloadUrlRequest, + com.google.cloud.functions.v1.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v1.GenerateDownloadUrlRequest, + com.google.cloud.functions.v1.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + if ((getGenerateDownloadUrlMethod = CloudFunctionsServiceGrpc.getGenerateDownloadUrlMethod) + == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getGenerateDownloadUrlMethod = CloudFunctionsServiceGrpc.getGenerateDownloadUrlMethod) + == null) { + CloudFunctionsServiceGrpc.getGenerateDownloadUrlMethod = + getGenerateDownloadUrlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateDownloadUrl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v1.GenerateDownloadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("GenerateDownloadUrl")) + .build(); + } + } + } + return getGenerateDownloadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SetIamPolicy", + requestType = com.google.iam.v1.SetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = CloudFunctionsServiceGrpc.getSetIamPolicyMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getSetIamPolicyMethod = CloudFunctionsServiceGrpc.getSetIamPolicyMethod) == null) { + CloudFunctionsServiceGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetIamPolicy", + requestType = com.google.iam.v1.GetIamPolicyRequest.class, + responseType = com.google.iam.v1.Policy.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = CloudFunctionsServiceGrpc.getGetIamPolicyMethod) == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getGetIamPolicyMethod = CloudFunctionsServiceGrpc.getGetIamPolicyMethod) == null) { + CloudFunctionsServiceGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TestIamPermissions", + requestType = com.google.iam.v1.TestIamPermissionsRequest.class, + responseType = com.google.iam.v1.TestIamPermissionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = CloudFunctionsServiceGrpc.getTestIamPermissionsMethod) + == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + if ((getTestIamPermissionsMethod = CloudFunctionsServiceGrpc.getTestIamPermissionsMethod) + == null) { + CloudFunctionsServiceGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new CloudFunctionsServiceMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudFunctionsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFunctionsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFunctionsServiceStub(channel, callOptions); + } + }; + return CloudFunctionsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudFunctionsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFunctionsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFunctionsServiceBlockingStub(channel, callOptions); + } + }; + return CloudFunctionsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudFunctionsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudFunctionsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFunctionsServiceFutureStub(channel, callOptions); + } + }; + return CloudFunctionsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * A service that application uses to manipulate triggers and functions.
+   * 
+ */ + public abstract static class CloudFunctionsServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v1.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListFunctionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v1.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void createFunction( + com.google.cloud.functions.v1.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v1.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteFunction( + com.google.cloud.functions.v1.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Synchronously invokes a deployed Cloud Function. To be used for testing
+     * purposes as very limited traffic is allowed. For more information on
+     * the actual limits, refer to
+     * [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).
+     * 
+ */ + public void callFunction( + com.google.cloud.functions.v1.CallFunctionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCallFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * Source file size should not exceed 100MB limit.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * * `x-goog-content-length-range: 0,104857600`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v1.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGenerateUploadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a 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
+     * 
+ */ + public void generateDownloadUrl( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGenerateDownloadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Sets the IAM access control policy on the specified function.
+     * Replaces any existing policy.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the IAM access control policy for a function.
+     * Returns an empty policy if the function exists and does not have a policy
+     * set.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIamPolicyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getTestIamPermissionsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListFunctionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.ListFunctionsRequest, + com.google.cloud.functions.v1.ListFunctionsResponse>( + this, METHODID_LIST_FUNCTIONS))) + .addMethod( + getGetFunctionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.GetFunctionRequest, + com.google.cloud.functions.v1.CloudFunction>(this, METHODID_GET_FUNCTION))) + .addMethod( + getCreateFunctionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.CreateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_FUNCTION))) + .addMethod( + getUpdateFunctionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.UpdateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_FUNCTION))) + .addMethod( + getDeleteFunctionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.DeleteFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_FUNCTION))) + .addMethod( + getCallFunctionMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.CallFunctionRequest, + com.google.cloud.functions.v1.CallFunctionResponse>( + this, METHODID_CALL_FUNCTION))) + .addMethod( + getGenerateUploadUrlMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.GenerateUploadUrlRequest, + com.google.cloud.functions.v1.GenerateUploadUrlResponse>( + this, METHODID_GENERATE_UPLOAD_URL))) + .addMethod( + getGenerateDownloadUrlMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v1.GenerateDownloadUrlRequest, + com.google.cloud.functions.v1.GenerateDownloadUrlResponse>( + this, METHODID_GENERATE_DOWNLOAD_URL))) + .addMethod( + getSetIamPolicyMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getGetIamPolicyMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * A service that application uses to manipulate triggers and functions.
+   * 
+ */ + public static final class CloudFunctionsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudFunctionsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFunctionsServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFunctionsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v1.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFunctionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v1.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void createFunction( + com.google.cloud.functions.v1.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v1.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void deleteFunction( + com.google.cloud.functions.v1.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Synchronously invokes a deployed Cloud Function. To be used for testing
+     * purposes as very limited traffic is allowed. For more information on
+     * the actual limits, refer to
+     * [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).
+     * 
+ */ + public void callFunction( + com.google.cloud.functions.v1.CallFunctionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCallFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * Source file size should not exceed 100MB limit.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * * `x-goog-content-length-range: 0,104857600`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v1.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGenerateUploadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a 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
+     * 
+ */ + public void generateDownloadUrl( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Sets the IAM access control policy on the specified function.
+     * Replaces any existing policy.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the IAM access control policy for a function.
+     * Returns an empty policy if the function exists and does not have a policy
+     * set.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * A service that application uses to manipulate triggers and functions.
+   * 
+ */ + public static final class CloudFunctionsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudFunctionsServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFunctionsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFunctionsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.cloud.functions.v1.ListFunctionsResponse listFunctions( + com.google.cloud.functions.v1.ListFunctionsRequest request) { + return blockingUnaryCall(getChannel(), getListFunctionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.cloud.functions.v1.CloudFunction getFunction( + com.google.cloud.functions.v1.GetFunctionRequest request) { + return blockingUnaryCall(getChannel(), getGetFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation createFunction( + com.google.cloud.functions.v1.CreateFunctionRequest request) { + return blockingUnaryCall(getChannel(), getCreateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.longrunning.Operation updateFunction( + com.google.cloud.functions.v1.UpdateFunctionRequest request) { + return blockingUnaryCall(getChannel(), getUpdateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation deleteFunction( + com.google.cloud.functions.v1.DeleteFunctionRequest request) { + return blockingUnaryCall(getChannel(), getDeleteFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Synchronously invokes a deployed Cloud Function. To be used for testing
+     * purposes as very limited traffic is allowed. For more information on
+     * the actual limits, refer to
+     * [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).
+     * 
+ */ + public com.google.cloud.functions.v1.CallFunctionResponse callFunction( + com.google.cloud.functions.v1.CallFunctionRequest request) { + return blockingUnaryCall(getChannel(), getCallFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * Source file size should not exceed 100MB limit.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * * `x-goog-content-length-range: 0,104857600`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.cloud.functions.v1.GenerateUploadUrlResponse generateUploadUrl( + com.google.cloud.functions.v1.GenerateUploadUrlRequest request) { + return blockingUnaryCall( + getChannel(), getGenerateUploadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a 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
+     * 
+ */ + public com.google.cloud.functions.v1.GenerateDownloadUrlResponse generateDownloadUrl( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest request) { + return blockingUnaryCall( + getChannel(), getGenerateDownloadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Sets the IAM access control policy on the specified function.
+     * Replaces any existing policy.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return blockingUnaryCall(getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the IAM access control policy for a function.
+     * Returns an empty policy if the function exists and does not have a policy
+     * set.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return blockingUnaryCall(getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return blockingUnaryCall( + getChannel(), getTestIamPermissionsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * A service that application uses to manipulate triggers and functions.
+   * 
+ */ + public static final class CloudFunctionsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudFunctionsServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudFunctionsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudFunctionsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v1.ListFunctionsResponse> + listFunctions(com.google.cloud.functions.v1.ListFunctionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFunctionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v1.CloudFunction> + getFunction(com.google.cloud.functions.v1.GetFunctionRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createFunction(com.google.cloud.functions.v1.CreateFunctionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateFunction(com.google.cloud.functions.v1.UpdateFunctionRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteFunction(com.google.cloud.functions.v1.DeleteFunctionRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Synchronously invokes a deployed Cloud Function. To be used for testing
+     * purposes as very limited traffic is allowed. For more information on
+     * the actual limits, refer to
+     * [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v1.CallFunctionResponse> + callFunction(com.google.cloud.functions.v1.CallFunctionRequest request) { + return futureUnaryCall( + getChannel().newCall(getCallFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * Source file size should not exceed 100MB limit.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * * `x-goog-content-length-range: 0,104857600`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v1.GenerateUploadUrlResponse> + generateUploadUrl(com.google.cloud.functions.v1.GenerateUploadUrlRequest request) { + return futureUnaryCall( + getChannel().newCall(getGenerateUploadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a 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
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v1.GenerateDownloadUrlResponse> + generateDownloadUrl(com.google.cloud.functions.v1.GenerateDownloadUrlRequest request) { + return futureUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Sets the IAM access control policy on the specified function.
+     * Replaces any existing policy.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the IAM access control policy for a function.
+     * Returns an empty policy if the function exists and does not have a policy
+     * set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_FUNCTIONS = 0; + private static final int METHODID_GET_FUNCTION = 1; + private static final int METHODID_CREATE_FUNCTION = 2; + private static final int METHODID_UPDATE_FUNCTION = 3; + private static final int METHODID_DELETE_FUNCTION = 4; + private static final int METHODID_CALL_FUNCTION = 5; + private static final int METHODID_GENERATE_UPLOAD_URL = 6; + private static final int METHODID_GENERATE_DOWNLOAD_URL = 7; + private static final int METHODID_SET_IAM_POLICY = 8; + private static final int METHODID_GET_IAM_POLICY = 9; + private static final int METHODID_TEST_IAM_PERMISSIONS = 10; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CloudFunctionsServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CloudFunctionsServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_FUNCTIONS: + serviceImpl.listFunctions( + (com.google.cloud.functions.v1.ListFunctionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_FUNCTION: + serviceImpl.getFunction( + (com.google.cloud.functions.v1.GetFunctionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_FUNCTION: + serviceImpl.createFunction( + (com.google.cloud.functions.v1.CreateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_FUNCTION: + serviceImpl.updateFunction( + (com.google.cloud.functions.v1.UpdateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_FUNCTION: + serviceImpl.deleteFunction( + (com.google.cloud.functions.v1.DeleteFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CALL_FUNCTION: + serviceImpl.callFunction( + (com.google.cloud.functions.v1.CallFunctionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_UPLOAD_URL: + serviceImpl.generateUploadUrl( + (com.google.cloud.functions.v1.GenerateUploadUrlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_DOWNLOAD_URL: + serviceImpl.generateDownloadUrl( + (com.google.cloud.functions.v1.GenerateDownloadUrlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v1.GenerateDownloadUrlResponse>) + responseObserver); + break; + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class CloudFunctionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudFunctionsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudFunctionsService"); + } + } + + private static final class CloudFunctionsServiceFileDescriptorSupplier + extends CloudFunctionsServiceBaseDescriptorSupplier { + CloudFunctionsServiceFileDescriptorSupplier() {} + } + + private static final class CloudFunctionsServiceMethodDescriptorSupplier + extends CloudFunctionsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CloudFunctionsServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CloudFunctionsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudFunctionsServiceFileDescriptorSupplier()) + .addMethod(getListFunctionsMethod()) + .addMethod(getGetFunctionMethod()) + .addMethod(getCreateFunctionMethod()) + .addMethod(getUpdateFunctionMethod()) + .addMethod(getDeleteFunctionMethod()) + .addMethod(getCallFunctionMethod()) + .addMethod(getGenerateUploadUrlMethod()) + .addMethod(getGenerateDownloadUrlMethod()) + .addMethod(getSetIamPolicyMethod()) + .addMethod(getGetIamPolicyMethod()) + .addMethod(getTestIamPermissionsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java.header b/java.header new file mode 100644 index 00000000..3a9b503a --- /dev/null +++ b/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/license-checks.xml b/license-checks.xml new file mode 100644 index 00000000..6597fced --- /dev/null +++ b/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 00000000..c22c6e1b --- /dev/null +++ b/pom.xml @@ -0,0 +1,186 @@ + + + 4.0.0 + com.google.cloud + google-cloud-functions-parent + pom + 0.0.1-SNAPSHOT + Google Cloud Functions Parent + https://github.com/googleapis/java-functions + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 0.5.0 + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-functions.git + scm:git:git@github.com:googleapis/java-functions.git + https://github.com/googleapis/java-functions + HEAD + + + https://github.com/googleapis/java-functions/issues + GitHub Issues + + + + sonatype-nexus-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + sonatype-nexus-staging + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-functions-parent + + + + + + com.google.cloud + google-cloud-functions + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-functions-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-functions-v1 + 0.0.1-SNAPSHOT + + + + com.google.cloud + google-cloud-shared-dependencies + 0.1.1 + pom + import + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + google-cloud-functions + proto-google-cloud-functions-v1 + grpc-google-cloud-functions-v1 + google-cloud-functions-bom + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + + index + dependency-info + team + ci-management + issue-management + licenses + scm + dependency-management + distribution-management + summary + modules + + + + + true + ${site.installationModule} + jar + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + html + + aggregate + javadoc + + + + + none + protected + true + ${project.build.directory}/javadoc + + + Test helpers packages + com.google.cloud.testing + + + SPI packages + com.google.cloud.spi* + + + + + https://grpc.io/grpc-java/javadoc/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://googleapis.dev/java/google-auth-library/latest/ + https://googleapis.dev/java/gax/latest/ + https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ + + + + + + \ No newline at end of file diff --git a/proto-google-cloud-functions-v1/pom.xml b/proto-google-cloud-functions-v1/pom.xml new file mode 100644 index 00000000..def9ffaa --- /dev/null +++ b/proto-google-cloud-functions-v1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-functions-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-functions-v1 + PROTO library for proto-google-cloud-functions-v1 + + com.google.cloud + google-cloud-functions-parent + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + com.google.api.grpc + proto-google-iam-v1 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionRequest.java new file mode 100644 index 00000000..94c255b8 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionRequest.java @@ -0,0 +1,829 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request for the `CallFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CallFunctionRequest} + */ +public final class CallFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.CallFunctionRequest) + CallFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CallFunctionRequest.newBuilder() to construct. + private CallFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CallFunctionRequest() { + name_ = ""; + data_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CallFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CallFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + data_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CallFunctionRequest.class, + com.google.cloud.functions.v1.CallFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function to be called.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function to be called.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private volatile java.lang.Object data_; + /** + * + * + *
+   * Required. Input to be passed to the function.
+   * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + @java.lang.Override + public java.lang.String getData() { + java.lang.Object ref = data_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + data_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Input to be passed to the function.
+   * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDataBytes() { + java.lang.Object ref = data_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + data_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDataBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, data_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDataBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.CallFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.CallFunctionRequest other = + (com.google.cloud.functions.v1.CallFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getData().equals(other.getData())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.CallFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `CallFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CallFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.CallFunctionRequest) + com.google.cloud.functions.v1.CallFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CallFunctionRequest.class, + com.google.cloud.functions.v1.CallFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.CallFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + data_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.CallFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionRequest build() { + com.google.cloud.functions.v1.CallFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionRequest buildPartial() { + com.google.cloud.functions.v1.CallFunctionRequest result = + new com.google.cloud.functions.v1.CallFunctionRequest(this); + result.name_ = name_; + result.data_ = data_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.CallFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v1.CallFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.CallFunctionRequest other) { + if (other == com.google.cloud.functions.v1.CallFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getData().isEmpty()) { + data_ = other.data_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.CallFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.CallFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function to be called.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to be called.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function to be called.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to be called.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function to be called.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object data_ = ""; + /** + * + * + *
+     * Required. Input to be passed to the function.
+     * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + public java.lang.String getData() { + java.lang.Object ref = data_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + data_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Input to be passed to the function.
+     * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for data. + */ + public com.google.protobuf.ByteString getDataBytes() { + java.lang.Object ref = data_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + data_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Input to be passed to the function.
+     * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input to be passed to the function.
+     * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Input to be passed to the function.
+     * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for data to set. + * @return This builder for chaining. + */ + public Builder setDataBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + data_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.CallFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.CallFunctionRequest) + private static final com.google.cloud.functions.v1.CallFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.CallFunctionRequest(); + } + + public static com.google.cloud.functions.v1.CallFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CallFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CallFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionRequestOrBuilder.java new file mode 100644 index 00000000..4a6b73f2 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionRequestOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface CallFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.CallFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function to be called.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function to be called.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. Input to be passed to the function.
+   * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The data. + */ + java.lang.String getData(); + /** + * + * + *
+   * Required. Input to be passed to the function.
+   * 
+ * + * string data = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for data. + */ + com.google.protobuf.ByteString getDataBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionResponse.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionResponse.java new file mode 100644 index 00000000..999acde9 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionResponse.java @@ -0,0 +1,1008 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Response of `CallFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CallFunctionResponse} + */ +public final class CallFunctionResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.CallFunctionResponse) + CallFunctionResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use CallFunctionResponse.newBuilder() to construct. + private CallFunctionResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CallFunctionResponse() { + executionId_ = ""; + result_ = ""; + error_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CallFunctionResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CallFunctionResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + executionId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + result_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + error_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CallFunctionResponse.class, + com.google.cloud.functions.v1.CallFunctionResponse.Builder.class); + } + + public static final int EXECUTION_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object executionId_; + /** + * + * + *
+   * Execution id of function invocation.
+   * 
+ * + * string execution_id = 1; + * + * @return The executionId. + */ + @java.lang.Override + public java.lang.String getExecutionId() { + java.lang.Object ref = executionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + executionId_ = s; + return s; + } + } + /** + * + * + *
+   * Execution id of function invocation.
+   * 
+ * + * string execution_id = 1; + * + * @return The bytes for executionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getExecutionIdBytes() { + java.lang.Object ref = executionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + executionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESULT_FIELD_NUMBER = 2; + private volatile java.lang.Object result_; + /** + * + * + *
+   * Result populated for successful execution of synchronous function. Will
+   * not be populated if function does not return a result through context.
+   * 
+ * + * string result = 2; + * + * @return The result. + */ + @java.lang.Override + public java.lang.String getResult() { + java.lang.Object ref = result_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + result_ = s; + return s; + } + } + /** + * + * + *
+   * Result populated for successful execution of synchronous function. Will
+   * not be populated if function does not return a result through context.
+   * 
+ * + * string result = 2; + * + * @return The bytes for result. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResultBytes() { + java.lang.Object ref = result_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + result_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 3; + private volatile java.lang.Object error_; + /** + * + * + *
+   * Either system or user-function generated error. Set if execution
+   * was not successful.
+   * 
+ * + * string error = 3; + * + * @return The error. + */ + @java.lang.Override + public java.lang.String getError() { + java.lang.Object ref = error_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + error_ = s; + return s; + } + } + /** + * + * + *
+   * Either system or user-function generated error. Set if execution
+   * was not successful.
+   * 
+ * + * string error = 3; + * + * @return The bytes for error. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorBytes() { + java.lang.Object ref = error_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + error_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getExecutionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, executionId_); + } + if (!getResultBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, result_); + } + if (!getErrorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, error_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getExecutionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, executionId_); + } + if (!getResultBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, result_); + } + if (!getErrorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, error_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.CallFunctionResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.CallFunctionResponse other = + (com.google.cloud.functions.v1.CallFunctionResponse) obj; + + if (!getExecutionId().equals(other.getExecutionId())) return false; + if (!getResult().equals(other.getResult())) return false; + if (!getError().equals(other.getError())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EXECUTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getExecutionId().hashCode(); + hash = (37 * hash) + RESULT_FIELD_NUMBER; + hash = (53 * hash) + getResult().hashCode(); + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.CallFunctionResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `CallFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CallFunctionResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.CallFunctionResponse) + com.google.cloud.functions.v1.CallFunctionResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CallFunctionResponse.class, + com.google.cloud.functions.v1.CallFunctionResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.CallFunctionResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + executionId_ = ""; + + result_ = ""; + + error_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CallFunctionResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v1.CallFunctionResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionResponse build() { + com.google.cloud.functions.v1.CallFunctionResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionResponse buildPartial() { + com.google.cloud.functions.v1.CallFunctionResponse result = + new com.google.cloud.functions.v1.CallFunctionResponse(this); + result.executionId_ = executionId_; + result.result_ = result_; + result.error_ = error_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.CallFunctionResponse) { + return mergeFrom((com.google.cloud.functions.v1.CallFunctionResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.CallFunctionResponse other) { + if (other == com.google.cloud.functions.v1.CallFunctionResponse.getDefaultInstance()) + return this; + if (!other.getExecutionId().isEmpty()) { + executionId_ = other.executionId_; + onChanged(); + } + if (!other.getResult().isEmpty()) { + result_ = other.result_; + onChanged(); + } + if (!other.getError().isEmpty()) { + error_ = other.error_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.CallFunctionResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.CallFunctionResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object executionId_ = ""; + /** + * + * + *
+     * Execution id of function invocation.
+     * 
+ * + * string execution_id = 1; + * + * @return The executionId. + */ + public java.lang.String getExecutionId() { + java.lang.Object ref = executionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + executionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Execution id of function invocation.
+     * 
+ * + * string execution_id = 1; + * + * @return The bytes for executionId. + */ + public com.google.protobuf.ByteString getExecutionIdBytes() { + java.lang.Object ref = executionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + executionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Execution id of function invocation.
+     * 
+ * + * string execution_id = 1; + * + * @param value The executionId to set. + * @return This builder for chaining. + */ + public Builder setExecutionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + executionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Execution id of function invocation.
+     * 
+ * + * string execution_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearExecutionId() { + + executionId_ = getDefaultInstance().getExecutionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Execution id of function invocation.
+     * 
+ * + * string execution_id = 1; + * + * @param value The bytes for executionId to set. + * @return This builder for chaining. + */ + public Builder setExecutionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + executionId_ = value; + onChanged(); + return this; + } + + private java.lang.Object result_ = ""; + /** + * + * + *
+     * Result populated for successful execution of synchronous function. Will
+     * not be populated if function does not return a result through context.
+     * 
+ * + * string result = 2; + * + * @return The result. + */ + public java.lang.String getResult() { + java.lang.Object ref = result_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + result_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Result populated for successful execution of synchronous function. Will
+     * not be populated if function does not return a result through context.
+     * 
+ * + * string result = 2; + * + * @return The bytes for result. + */ + public com.google.protobuf.ByteString getResultBytes() { + java.lang.Object ref = result_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + result_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Result populated for successful execution of synchronous function. Will
+     * not be populated if function does not return a result through context.
+     * 
+ * + * string result = 2; + * + * @param value The result to set. + * @return This builder for chaining. + */ + public Builder setResult(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + result_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Result populated for successful execution of synchronous function. Will
+     * not be populated if function does not return a result through context.
+     * 
+ * + * string result = 2; + * + * @return This builder for chaining. + */ + public Builder clearResult() { + + result_ = getDefaultInstance().getResult(); + onChanged(); + return this; + } + /** + * + * + *
+     * Result populated for successful execution of synchronous function. Will
+     * not be populated if function does not return a result through context.
+     * 
+ * + * string result = 2; + * + * @param value The bytes for result to set. + * @return This builder for chaining. + */ + public Builder setResultBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + result_ = value; + onChanged(); + return this; + } + + private java.lang.Object error_ = ""; + /** + * + * + *
+     * Either system or user-function generated error. Set if execution
+     * was not successful.
+     * 
+ * + * string error = 3; + * + * @return The error. + */ + public java.lang.String getError() { + java.lang.Object ref = error_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + error_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Either system or user-function generated error. Set if execution
+     * was not successful.
+     * 
+ * + * string error = 3; + * + * @return The bytes for error. + */ + public com.google.protobuf.ByteString getErrorBytes() { + java.lang.Object ref = error_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + error_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Either system or user-function generated error. Set if execution
+     * was not successful.
+     * 
+ * + * string error = 3; + * + * @param value The error to set. + * @return This builder for chaining. + */ + public Builder setError(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + error_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Either system or user-function generated error. Set if execution
+     * was not successful.
+     * 
+ * + * string error = 3; + * + * @return This builder for chaining. + */ + public Builder clearError() { + + error_ = getDefaultInstance().getError(); + onChanged(); + return this; + } + /** + * + * + *
+     * Either system or user-function generated error. Set if execution
+     * was not successful.
+     * 
+ * + * string error = 3; + * + * @param value The bytes for error to set. + * @return This builder for chaining. + */ + public Builder setErrorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + error_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.CallFunctionResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.CallFunctionResponse) + private static final com.google.cloud.functions.v1.CallFunctionResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.CallFunctionResponse(); + } + + public static com.google.cloud.functions.v1.CallFunctionResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CallFunctionResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CallFunctionResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CallFunctionResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionResponseOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionResponseOrBuilder.java new file mode 100644 index 00000000..4bb656e9 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CallFunctionResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface CallFunctionResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.CallFunctionResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Execution id of function invocation.
+   * 
+ * + * string execution_id = 1; + * + * @return The executionId. + */ + java.lang.String getExecutionId(); + /** + * + * + *
+   * Execution id of function invocation.
+   * 
+ * + * string execution_id = 1; + * + * @return The bytes for executionId. + */ + com.google.protobuf.ByteString getExecutionIdBytes(); + + /** + * + * + *
+   * Result populated for successful execution of synchronous function. Will
+   * not be populated if function does not return a result through context.
+   * 
+ * + * string result = 2; + * + * @return The result. + */ + java.lang.String getResult(); + /** + * + * + *
+   * Result populated for successful execution of synchronous function. Will
+   * not be populated if function does not return a result through context.
+   * 
+ * + * string result = 2; + * + * @return The bytes for result. + */ + com.google.protobuf.ByteString getResultBytes(); + + /** + * + * + *
+   * Either system or user-function generated error. Set if execution
+   * was not successful.
+   * 
+ * + * string error = 3; + * + * @return The error. + */ + java.lang.String getError(); + /** + * + * + *
+   * Either system or user-function generated error. Set if execution
+   * was not successful.
+   * 
+ * + * string error = 3; + * + * @return The bytes for error. + */ + com.google.protobuf.ByteString getErrorBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java new file mode 100644 index 00000000..87d7793c --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java @@ -0,0 +1,5983 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Describes a Cloud Function that contains user computation executed in
+ * response to an event. It encapsulate function and triggers configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CloudFunction} + */ +public final class CloudFunction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.CloudFunction) + CloudFunctionOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloudFunction.newBuilder() to construct. + private CloudFunction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloudFunction() { + name_ = ""; + description_ = ""; + status_ = 0; + entryPoint_ = ""; + runtime_ = ""; + serviceAccountEmail_ = ""; + network_ = ""; + vpcConnector_ = ""; + vpcConnectorEgressSettings_ = 0; + ingressSettings_ = 0; + buildId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudFunction(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CloudFunction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCodeCase_ = 3; + sourceCode_ = s; + break; + } + case 34: + { + com.google.cloud.functions.v1.SourceRepository.Builder subBuilder = null; + if (sourceCodeCase_ == 4) { + subBuilder = + ((com.google.cloud.functions.v1.SourceRepository) sourceCode_).toBuilder(); + } + sourceCode_ = + input.readMessage( + com.google.cloud.functions.v1.SourceRepository.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v1.SourceRepository) sourceCode_); + sourceCode_ = subBuilder.buildPartial(); + } + sourceCodeCase_ = 4; + break; + } + case 42: + { + com.google.cloud.functions.v1.HttpsTrigger.Builder subBuilder = null; + if (triggerCase_ == 5) { + subBuilder = ((com.google.cloud.functions.v1.HttpsTrigger) trigger_).toBuilder(); + } + trigger_ = + input.readMessage( + com.google.cloud.functions.v1.HttpsTrigger.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v1.HttpsTrigger) trigger_); + trigger_ = subBuilder.buildPartial(); + } + triggerCase_ = 5; + break; + } + case 50: + { + com.google.cloud.functions.v1.EventTrigger.Builder subBuilder = null; + if (triggerCase_ == 6) { + subBuilder = ((com.google.cloud.functions.v1.EventTrigger) trigger_).toBuilder(); + } + trigger_ = + input.readMessage( + com.google.cloud.functions.v1.EventTrigger.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v1.EventTrigger) trigger_); + trigger_ = subBuilder.buildPartial(); + } + triggerCase_ = 6; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + status_ = rawValue; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + entryPoint_ = s; + break; + } + case 74: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeout_ != null) { + subBuilder = timeout_.toBuilder(); + } + timeout_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeout_); + timeout_ = subBuilder.buildPartial(); + } + + break; + } + case 80: + { + availableMemoryMb_ = input.readInt32(); + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 98: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 112: + { + versionId_ = input.readInt64(); + break; + } + case 122: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 130: + { + java.lang.String s = input.readStringRequireUtf8(); + sourceCodeCase_ = 16; + sourceCode_ = s; + break; + } + case 138: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + + network_ = s; + break; + } + case 154: + { + java.lang.String s = input.readStringRequireUtf8(); + + runtime_ = s; + break; + } + case 160: + { + maxInstances_ = input.readInt32(); + break; + } + case 178: + { + java.lang.String s = input.readStringRequireUtf8(); + + vpcConnector_ = s; + break; + } + case 184: + { + int rawValue = input.readEnum(); + + vpcConnectorEgressSettings_ = rawValue; + break; + } + case 192: + { + int rawValue = input.readEnum(); + + ingressSettings_ = rawValue; + break; + } + case 218: + { + java.lang.String s = input.readStringRequireUtf8(); + + buildId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 15: + return internalGetLabels(); + case 17: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CloudFunction.class, + com.google.cloud.functions.v1.CloudFunction.Builder.class); + } + + /** + * + * + *
+   * Available egress settings.
+   * This controls what traffic is diverted through the VPC Access Connector
+   * resource. By default PRIVATE_RANGES_ONLY will be used.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings} + */ + public enum VpcConnectorEgressSettings implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + */ + VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED(0), + /** + * + * + *
+     * Use the VPC Access Connector only for private IP space from RFC1918.
+     * 
+ * + * PRIVATE_RANGES_ONLY = 1; + */ + PRIVATE_RANGES_ONLY(1), + /** + * + * + *
+     * Force the use of VPC Access Connector for all egress traffic from the
+     * function.
+     * 
+ * + * ALL_TRAFFIC = 2; + */ + ALL_TRAFFIC(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + */ + public static final int VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Use the VPC Access Connector only for private IP space from RFC1918.
+     * 
+ * + * PRIVATE_RANGES_ONLY = 1; + */ + public static final int PRIVATE_RANGES_ONLY_VALUE = 1; + /** + * + * + *
+     * Force the use of VPC Access Connector for all egress traffic from the
+     * function.
+     * 
+ * + * ALL_TRAFFIC = 2; + */ + public static final int ALL_TRAFFIC_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VpcConnectorEgressSettings valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static VpcConnectorEgressSettings forNumber(int value) { + switch (value) { + case 0: + return VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED; + case 1: + return PRIVATE_RANGES_ONLY; + case 2: + return ALL_TRAFFIC; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public VpcConnectorEgressSettings findValueByNumber(int number) { + return VpcConnectorEgressSettings.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v1.CloudFunction.getDescriptor().getEnumTypes().get(0); + } + + private static final VpcConnectorEgressSettings[] VALUES = values(); + + public static VpcConnectorEgressSettings valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private VpcConnectorEgressSettings(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings) + } + + /** + * + * + *
+   * Available ingress settings.
+   * This controls what traffic can reach the function.
+   * If unspecified, ALLOW_ALL will be used.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v1.CloudFunction.IngressSettings} + */ + public enum IngressSettings implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * INGRESS_SETTINGS_UNSPECIFIED = 0; + */ + INGRESS_SETTINGS_UNSPECIFIED(0), + /** + * + * + *
+     * Allow HTTP traffic from public and private sources.
+     * 
+ * + * ALLOW_ALL = 1; + */ + ALLOW_ALL(1), + /** + * + * + *
+     * Allow HTTP traffic from only private VPC sources.
+     * 
+ * + * ALLOW_INTERNAL_ONLY = 2; + */ + ALLOW_INTERNAL_ONLY(2), + /** + * + * + *
+     * Allow HTTP traffic from private VPC sources and through GCLB.
+     * 
+ * + * ALLOW_INTERNAL_AND_GCLB = 3; + */ + ALLOW_INTERNAL_AND_GCLB(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * INGRESS_SETTINGS_UNSPECIFIED = 0; + */ + public static final int INGRESS_SETTINGS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allow HTTP traffic from public and private sources.
+     * 
+ * + * ALLOW_ALL = 1; + */ + public static final int ALLOW_ALL_VALUE = 1; + /** + * + * + *
+     * Allow HTTP traffic from only private VPC sources.
+     * 
+ * + * ALLOW_INTERNAL_ONLY = 2; + */ + public static final int ALLOW_INTERNAL_ONLY_VALUE = 2; + /** + * + * + *
+     * Allow HTTP traffic from private VPC sources and through GCLB.
+     * 
+ * + * ALLOW_INTERNAL_AND_GCLB = 3; + */ + public static final int ALLOW_INTERNAL_AND_GCLB_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IngressSettings valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static IngressSettings forNumber(int value) { + switch (value) { + case 0: + return INGRESS_SETTINGS_UNSPECIFIED; + case 1: + return ALLOW_ALL; + case 2: + return ALLOW_INTERNAL_ONLY; + case 3: + return ALLOW_INTERNAL_AND_GCLB; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public IngressSettings findValueByNumber(int number) { + return IngressSettings.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v1.CloudFunction.getDescriptor().getEnumTypes().get(1); + } + + private static final IngressSettings[] VALUES = values(); + + public static IngressSettings valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private IngressSettings(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v1.CloudFunction.IngressSettings) + } + + private int sourceCodeCase_ = 0; + private java.lang.Object sourceCode_; + + public enum SourceCodeCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + SOURCE_ARCHIVE_URL(3), + SOURCE_REPOSITORY(4), + SOURCE_UPLOAD_URL(16), + SOURCECODE_NOT_SET(0); + private final int value; + + private SourceCodeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCodeCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCodeCase forNumber(int value) { + switch (value) { + case 3: + return SOURCE_ARCHIVE_URL; + case 4: + return SOURCE_REPOSITORY; + case 16: + return SOURCE_UPLOAD_URL; + case 0: + return SOURCECODE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCodeCase getSourceCodeCase() { + return SourceCodeCase.forNumber(sourceCodeCase_); + } + + private int triggerCase_ = 0; + private java.lang.Object trigger_; + + public enum TriggerCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + HTTPS_TRIGGER(5), + EVENT_TRIGGER(6), + TRIGGER_NOT_SET(0); + private final int value; + + private TriggerCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TriggerCase valueOf(int value) { + return forNumber(value); + } + + public static TriggerCase forNumber(int value) { + switch (value) { + case 5: + return HTTPS_TRIGGER; + case 6: + return EVENT_TRIGGER; + case 0: + return TRIGGER_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public TriggerCase getTriggerCase() { + return TriggerCase.forNumber(triggerCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_ARCHIVE_URL_FIELD_NUMBER = 3; + /** + * + * + *
+   * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+   * archive which contains the function.
+   * 
+ * + * string source_archive_url = 3; + * + * @return The sourceArchiveUrl. + */ + public java.lang.String getSourceArchiveUrl() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 3) { + ref = sourceCode_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCodeCase_ == 3) { + sourceCode_ = s; + } + return s; + } + } + /** + * + * + *
+   * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+   * archive which contains the function.
+   * 
+ * + * string source_archive_url = 3; + * + * @return The bytes for sourceArchiveUrl. + */ + public com.google.protobuf.ByteString getSourceArchiveUrlBytes() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 3) { + ref = sourceCode_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCodeCase_ == 3) { + sourceCode_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_REPOSITORY_FIELD_NUMBER = 4; + /** + * + * + *
+   * **Beta Feature**
+   * The source repository where a function is hosted.
+   * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + * + * @return Whether the sourceRepository field is set. + */ + @java.lang.Override + public boolean hasSourceRepository() { + return sourceCodeCase_ == 4; + } + /** + * + * + *
+   * **Beta Feature**
+   * The source repository where a function is hosted.
+   * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + * + * @return The sourceRepository. + */ + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepository getSourceRepository() { + if (sourceCodeCase_ == 4) { + return (com.google.cloud.functions.v1.SourceRepository) sourceCode_; + } + return com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } + /** + * + * + *
+   * **Beta Feature**
+   * The source repository where a function is hosted.
+   * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepositoryOrBuilder getSourceRepositoryOrBuilder() { + if (sourceCodeCase_ == 4) { + return (com.google.cloud.functions.v1.SourceRepository) sourceCode_; + } + return com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } + + public static final int SOURCE_UPLOAD_URL_FIELD_NUMBER = 16; + /** + * + * + *
+   * The Google Cloud Storage signed URL used for source uploading, generated
+   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * 
+ * + * string source_upload_url = 16; + * + * @return The sourceUploadUrl. + */ + public java.lang.String getSourceUploadUrl() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 16) { + ref = sourceCode_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCodeCase_ == 16) { + sourceCode_ = s; + } + return s; + } + } + /** + * + * + *
+   * The Google Cloud Storage signed URL used for source uploading, generated
+   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * 
+ * + * string source_upload_url = 16; + * + * @return The bytes for sourceUploadUrl. + */ + public com.google.protobuf.ByteString getSourceUploadUrlBytes() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 16) { + ref = sourceCode_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCodeCase_ == 16) { + sourceCode_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTPS_TRIGGER_FIELD_NUMBER = 5; + /** + * + * + *
+   * An HTTPS endpoint type of source that can be triggered via URL.
+   * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + * + * @return Whether the httpsTrigger field is set. + */ + @java.lang.Override + public boolean hasHttpsTrigger() { + return triggerCase_ == 5; + } + /** + * + * + *
+   * An HTTPS endpoint type of source that can be triggered via URL.
+   * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + * + * @return The httpsTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTrigger getHttpsTrigger() { + if (triggerCase_ == 5) { + return (com.google.cloud.functions.v1.HttpsTrigger) trigger_; + } + return com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } + /** + * + * + *
+   * An HTTPS endpoint type of source that can be triggered via URL.
+   * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTriggerOrBuilder getHttpsTriggerOrBuilder() { + if (triggerCase_ == 5) { + return (com.google.cloud.functions.v1.HttpsTrigger) trigger_; + } + return com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } + + public static final int EVENT_TRIGGER_FIELD_NUMBER = 6; + /** + * + * + *
+   * A source that fires events in response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + * + * @return Whether the eventTrigger field is set. + */ + @java.lang.Override + public boolean hasEventTrigger() { + return triggerCase_ == 6; + } + /** + * + * + *
+   * A source that fires events in response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + * + * @return The eventTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v1.EventTrigger getEventTrigger() { + if (triggerCase_ == 6) { + return (com.google.cloud.functions.v1.EventTrigger) trigger_; + } + return com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } + /** + * + * + *
+   * A source that fires events in response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v1.EventTriggerOrBuilder getEventTriggerOrBuilder() { + if (triggerCase_ == 6) { + return (com.google.cloud.functions.v1.EventTrigger) trigger_; + } + return com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } + + public static final int STATUS_FIELD_NUMBER = 7; + private int status_; + /** + * + * + *
+   * Output only. Status of the function deployment.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + /** + * + * + *
+   * Output only. Status of the function deployment.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunctionStatus getStatus() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunctionStatus result = + com.google.cloud.functions.v1.CloudFunctionStatus.valueOf(status_); + return result == null ? com.google.cloud.functions.v1.CloudFunctionStatus.UNRECOGNIZED : result; + } + + public static final int ENTRY_POINT_FIELD_NUMBER = 8; + private volatile java.lang.Object entryPoint_; + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 8; + * + * @return The entryPoint. + */ + @java.lang.Override + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 8; + * + * @return The bytes for entryPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUNTIME_FIELD_NUMBER = 19; + private volatile java.lang.Object runtime_; + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 19; + * + * @return The runtime. + */ + @java.lang.Override + public java.lang.String getRuntime() { + java.lang.Object ref = runtime_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtime_ = s; + return s; + } + } + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 19; + * + * @return The bytes for runtime. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuntimeBytes() { + java.lang.Object ref = runtime_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMEOUT_FIELD_NUMBER = 9; + private com.google.protobuf.Duration timeout_; + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 9; + * + * @return Whether the timeout field is set. + */ + @java.lang.Override + public boolean hasTimeout() { + return timeout_ != null; + } + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 9; + * + * @return The timeout. + */ + @java.lang.Override + public com.google.protobuf.Duration getTimeout() { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { + return getTimeout(); + } + + public static final int AVAILABLE_MEMORY_MB_FIELD_NUMBER = 10; + private int availableMemoryMb_; + /** + * + * + *
+   * The amount of memory in MB available for a function.
+   * Defaults to 256MB.
+   * 
+ * + * int32 available_memory_mb = 10; + * + * @return The availableMemoryMb. + */ + @java.lang.Override + public int getAvailableMemoryMb() { + return availableMemoryMb_; + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 11; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * The email of the function's service account. If empty, defaults to
+   * `{project_id}@appspot.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 11; + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * The email of the function's service account. If empty, defaults to
+   * `{project_id}@appspot.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 11; + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int VERSION_ID_FIELD_NUMBER = 14; + private long versionId_; + /** + * + * + *
+   * Output only. The version identifier of the Cloud Function. Each deployment attempt
+   * results in a new version of a function being created.
+   * 
+ * + * int64 version_id = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The versionId. + */ + @java.lang.Override + public long getVersionId() { + return versionId_; + } + + public static final int LABELS_FIELD_NUMBER = 15; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 17; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_EnvironmentVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NETWORK_FIELD_NUMBER = 18; + private volatile java.lang.Object network_; + /** + * + * + *
+   * The VPC Network that this cloud function can connect to. It can be
+   * either the fully-qualified URI, or the short name of the network resource.
+   * If the short network name is used, the network must belong to the same
+   * project. Otherwise, it must belong to a project within the same
+   * organization. The format of this field is either
+   * `projects/{project}/global/networks/{network}` or `{network}`, where
+   * {project} is a project id where the network is defined, and {network} is
+   * the short name of the network.
+   * This field is mutually exclusive with `vpc_connector` and will be replaced
+   * by it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string network = 18; + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * The VPC Network that this cloud function can connect to. It can be
+   * either the fully-qualified URI, or the short name of the network resource.
+   * If the short network name is used, the network must belong to the same
+   * project. Otherwise, it must belong to a project within the same
+   * organization. The format of this field is either
+   * `projects/{project}/global/networks/{network}` or `{network}`, where
+   * {project} is a project id where the network is defined, and {network} is
+   * the short name of the network.
+   * This field is mutually exclusive with `vpc_connector` and will be replaced
+   * by it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string network = 18; + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_INSTANCES_FIELD_NUMBER = 20; + private int maxInstances_; + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * 
+ * + * int32 max_instances = 20; + * + * @return The maxInstances. + */ + @java.lang.Override + public int getMaxInstances() { + return maxInstances_; + } + + public static final int VPC_CONNECTOR_FIELD_NUMBER = 22; + private volatile java.lang.Object vpcConnector_; + /** + * + * + *
+   * The VPC Network Connector that this cloud function can connect to. It can
+   * be either the fully-qualified URI, or the short name of the network
+   * connector resource. The format of this field is
+   * `projects/*/locations/*/connectors/*`
+   * This field is mutually exclusive with `network` field and will eventually
+   * replace it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string vpc_connector = 22; + * + * @return The vpcConnector. + */ + @java.lang.Override + public java.lang.String getVpcConnector() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vpcConnector_ = s; + return s; + } + } + /** + * + * + *
+   * The VPC Network Connector that this cloud function can connect to. It can
+   * be either the fully-qualified URI, or the short name of the network
+   * connector resource. The format of this field is
+   * `projects/*/locations/*/connectors/*`
+   * This field is mutually exclusive with `network` field and will eventually
+   * replace it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string vpc_connector = 22; + * + * @return The bytes for vpcConnector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVpcConnectorBytes() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vpcConnector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER = 23; + private int vpcConnectorEgressSettings_; + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + @java.lang.Override + public int getVpcConnectorEgressSettingsValue() { + return vpcConnectorEgressSettings_; + } + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings result = + com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + + public static final int INGRESS_SETTINGS_FIELD_NUMBER = 24; + private int ingressSettings_; + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return The enum numeric value on the wire for ingressSettings. + */ + @java.lang.Override + public int getIngressSettingsValue() { + return ingressSettings_; + } + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunction.IngressSettings result = + com.google.cloud.functions.v1.CloudFunction.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v1.CloudFunction.IngressSettings.UNRECOGNIZED + : result; + } + + public static final int BUILD_ID_FIELD_NUMBER = 27; + private volatile java.lang.Object buildId_; + /** + * + * + *
+   * Output only. The Cloud Build ID of the latest successful deployment of the
+   * function.
+   * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The buildId. + */ + @java.lang.Override + public java.lang.String getBuildId() { + java.lang.Object ref = buildId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + buildId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The Cloud Build ID of the latest successful deployment of the
+   * function.
+   * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for buildId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildIdBytes() { + java.lang.Object ref = buildId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (sourceCodeCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceCode_); + } + if (sourceCodeCase_ == 4) { + output.writeMessage(4, (com.google.cloud.functions.v1.SourceRepository) sourceCode_); + } + if (triggerCase_ == 5) { + output.writeMessage(5, (com.google.cloud.functions.v1.HttpsTrigger) trigger_); + } + if (triggerCase_ == 6) { + output.writeMessage(6, (com.google.cloud.functions.v1.EventTrigger) trigger_); + } + if (status_ + != com.google.cloud.functions.v1.CloudFunctionStatus.CLOUD_FUNCTION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, status_); + } + if (!getEntryPointBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, entryPoint_); + } + if (timeout_ != null) { + output.writeMessage(9, getTimeout()); + } + if (availableMemoryMb_ != 0) { + output.writeInt32(10, availableMemoryMb_); + } + if (!getServiceAccountEmailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, serviceAccountEmail_); + } + if (updateTime_ != null) { + output.writeMessage(12, getUpdateTime()); + } + if (versionId_ != 0L) { + output.writeInt64(14, versionId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 15); + if (sourceCodeCase_ == 16) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, sourceCode_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 17); + if (!getNetworkBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, network_); + } + if (!getRuntimeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 19, runtime_); + } + if (maxInstances_ != 0) { + output.writeInt32(20, maxInstances_); + } + if (!getVpcConnectorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(23, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v1.CloudFunction.IngressSettings.INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(24, ingressSettings_); + } + if (!getBuildIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, buildId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (sourceCodeCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceCode_); + } + if (sourceCodeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.cloud.functions.v1.SourceRepository) sourceCode_); + } + if (triggerCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.cloud.functions.v1.HttpsTrigger) trigger_); + } + if (triggerCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.cloud.functions.v1.EventTrigger) trigger_); + } + if (status_ + != com.google.cloud.functions.v1.CloudFunctionStatus.CLOUD_FUNCTION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, status_); + } + if (!getEntryPointBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, entryPoint_); + } + if (timeout_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTimeout()); + } + if (availableMemoryMb_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(10, availableMemoryMb_); + } + if (!getServiceAccountEmailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, serviceAccountEmail_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getUpdateTime()); + } + if (versionId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(14, versionId_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, labels__); + } + if (sourceCodeCase_ == 16) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, sourceCode_); + } + for (java.util.Map.Entry entry : + internalGetEnvironmentVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry environmentVariables__ = + EnvironmentVariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, environmentVariables__); + } + if (!getNetworkBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, network_); + } + if (!getRuntimeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, runtime_); + } + if (maxInstances_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(20, maxInstances_); + } + if (!getVpcConnectorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(23, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v1.CloudFunction.IngressSettings.INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(24, ingressSettings_); + } + if (!getBuildIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, buildId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.CloudFunction)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.CloudFunction other = + (com.google.cloud.functions.v1.CloudFunction) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (status_ != other.status_) return false; + if (!getEntryPoint().equals(other.getEntryPoint())) return false; + if (!getRuntime().equals(other.getRuntime())) return false; + if (hasTimeout() != other.hasTimeout()) return false; + if (hasTimeout()) { + if (!getTimeout().equals(other.getTimeout())) return false; + } + if (getAvailableMemoryMb() != other.getAvailableMemoryMb()) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (getVersionId() != other.getVersionId()) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (getMaxInstances() != other.getMaxInstances()) return false; + if (!getVpcConnector().equals(other.getVpcConnector())) return false; + if (vpcConnectorEgressSettings_ != other.vpcConnectorEgressSettings_) return false; + if (ingressSettings_ != other.ingressSettings_) return false; + if (!getBuildId().equals(other.getBuildId())) return false; + if (!getSourceCodeCase().equals(other.getSourceCodeCase())) return false; + switch (sourceCodeCase_) { + case 3: + if (!getSourceArchiveUrl().equals(other.getSourceArchiveUrl())) return false; + break; + case 4: + if (!getSourceRepository().equals(other.getSourceRepository())) return false; + break; + case 16: + if (!getSourceUploadUrl().equals(other.getSourceUploadUrl())) return false; + break; + case 0: + default: + } + if (!getTriggerCase().equals(other.getTriggerCase())) return false; + switch (triggerCase_) { + case 5: + if (!getHttpsTrigger().equals(other.getHttpsTrigger())) return false; + break; + case 6: + if (!getEventTrigger().equals(other.getEventTrigger())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (37 * hash) + ENTRY_POINT_FIELD_NUMBER; + hash = (53 * hash) + getEntryPoint().hashCode(); + hash = (37 * hash) + RUNTIME_FIELD_NUMBER; + hash = (53 * hash) + getRuntime().hashCode(); + if (hasTimeout()) { + hash = (37 * hash) + TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getTimeout().hashCode(); + } + hash = (37 * hash) + AVAILABLE_MEMORY_MB_FIELD_NUMBER; + hash = (53 * hash) + getAvailableMemoryMb(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersionId()); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (37 * hash) + MAX_INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getMaxInstances(); + hash = (37 * hash) + VPC_CONNECTOR_FIELD_NUMBER; + hash = (53 * hash) + getVpcConnector().hashCode(); + hash = (37 * hash) + VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + vpcConnectorEgressSettings_; + hash = (37 * hash) + INGRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + ingressSettings_; + hash = (37 * hash) + BUILD_ID_FIELD_NUMBER; + hash = (53 * hash) + getBuildId().hashCode(); + switch (sourceCodeCase_) { + case 3: + hash = (37 * hash) + SOURCE_ARCHIVE_URL_FIELD_NUMBER; + hash = (53 * hash) + getSourceArchiveUrl().hashCode(); + break; + case 4: + hash = (37 * hash) + SOURCE_REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getSourceRepository().hashCode(); + break; + case 16: + hash = (37 * hash) + SOURCE_UPLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getSourceUploadUrl().hashCode(); + break; + case 0: + default: + } + switch (triggerCase_) { + case 5: + hash = (37 * hash) + HTTPS_TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getHttpsTrigger().hashCode(); + break; + case 6: + hash = (37 * hash) + EVENT_TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getEventTrigger().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CloudFunction parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CloudFunction parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CloudFunction parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.CloudFunction prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes a Cloud Function that contains user computation executed in
+   * response to an event. It encapsulate function and triggers configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CloudFunction} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.CloudFunction) + com.google.cloud.functions.v1.CloudFunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 15: + return internalGetLabels(); + case 17: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 15: + return internalGetMutableLabels(); + case 17: + return internalGetMutableEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CloudFunction.class, + com.google.cloud.functions.v1.CloudFunction.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.CloudFunction.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + status_ = 0; + + entryPoint_ = ""; + + runtime_ = ""; + + if (timeoutBuilder_ == null) { + timeout_ = null; + } else { + timeout_ = null; + timeoutBuilder_ = null; + } + availableMemoryMb_ = 0; + + serviceAccountEmail_ = ""; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + versionId_ = 0L; + + internalGetMutableLabels().clear(); + internalGetMutableEnvironmentVariables().clear(); + network_ = ""; + + maxInstances_ = 0; + + vpcConnector_ = ""; + + vpcConnectorEgressSettings_ = 0; + + ingressSettings_ = 0; + + buildId_ = ""; + + sourceCodeCase_ = 0; + sourceCode_ = null; + triggerCase_ = 0; + trigger_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CloudFunction_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction getDefaultInstanceForType() { + return com.google.cloud.functions.v1.CloudFunction.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction build() { + com.google.cloud.functions.v1.CloudFunction result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction buildPartial() { + com.google.cloud.functions.v1.CloudFunction result = + new com.google.cloud.functions.v1.CloudFunction(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.description_ = description_; + if (sourceCodeCase_ == 3) { + result.sourceCode_ = sourceCode_; + } + if (sourceCodeCase_ == 4) { + if (sourceRepositoryBuilder_ == null) { + result.sourceCode_ = sourceCode_; + } else { + result.sourceCode_ = sourceRepositoryBuilder_.build(); + } + } + if (sourceCodeCase_ == 16) { + result.sourceCode_ = sourceCode_; + } + if (triggerCase_ == 5) { + if (httpsTriggerBuilder_ == null) { + result.trigger_ = trigger_; + } else { + result.trigger_ = httpsTriggerBuilder_.build(); + } + } + if (triggerCase_ == 6) { + if (eventTriggerBuilder_ == null) { + result.trigger_ = trigger_; + } else { + result.trigger_ = eventTriggerBuilder_.build(); + } + } + result.status_ = status_; + result.entryPoint_ = entryPoint_; + result.runtime_ = runtime_; + if (timeoutBuilder_ == null) { + result.timeout_ = timeout_; + } else { + result.timeout_ = timeoutBuilder_.build(); + } + result.availableMemoryMb_ = availableMemoryMb_; + result.serviceAccountEmail_ = serviceAccountEmail_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.versionId_ = versionId_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.network_ = network_; + result.maxInstances_ = maxInstances_; + result.vpcConnector_ = vpcConnector_; + result.vpcConnectorEgressSettings_ = vpcConnectorEgressSettings_; + result.ingressSettings_ = ingressSettings_; + result.buildId_ = buildId_; + result.sourceCodeCase_ = sourceCodeCase_; + result.triggerCase_ = triggerCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.CloudFunction) { + return mergeFrom((com.google.cloud.functions.v1.CloudFunction) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.CloudFunction other) { + if (other == com.google.cloud.functions.v1.CloudFunction.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (!other.getEntryPoint().isEmpty()) { + entryPoint_ = other.entryPoint_; + onChanged(); + } + if (!other.getRuntime().isEmpty()) { + runtime_ = other.runtime_; + onChanged(); + } + if (other.hasTimeout()) { + mergeTimeout(other.getTimeout()); + } + if (other.getAvailableMemoryMb() != 0) { + setAvailableMemoryMb(other.getAvailableMemoryMb()); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getVersionId() != 0L) { + setVersionId(other.getVersionId()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + onChanged(); + } + if (other.getMaxInstances() != 0) { + setMaxInstances(other.getMaxInstances()); + } + if (!other.getVpcConnector().isEmpty()) { + vpcConnector_ = other.vpcConnector_; + onChanged(); + } + if (other.vpcConnectorEgressSettings_ != 0) { + setVpcConnectorEgressSettingsValue(other.getVpcConnectorEgressSettingsValue()); + } + if (other.ingressSettings_ != 0) { + setIngressSettingsValue(other.getIngressSettingsValue()); + } + if (!other.getBuildId().isEmpty()) { + buildId_ = other.buildId_; + onChanged(); + } + switch (other.getSourceCodeCase()) { + case SOURCE_ARCHIVE_URL: + { + sourceCodeCase_ = 3; + sourceCode_ = other.sourceCode_; + onChanged(); + break; + } + case SOURCE_REPOSITORY: + { + mergeSourceRepository(other.getSourceRepository()); + break; + } + case SOURCE_UPLOAD_URL: + { + sourceCodeCase_ = 16; + sourceCode_ = other.sourceCode_; + onChanged(); + break; + } + case SOURCECODE_NOT_SET: + { + break; + } + } + switch (other.getTriggerCase()) { + case HTTPS_TRIGGER: + { + mergeHttpsTrigger(other.getHttpsTrigger()); + break; + } + case EVENT_TRIGGER: + { + mergeEventTrigger(other.getEventTrigger()); + break; + } + case TRIGGER_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.CloudFunction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v1.CloudFunction) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCodeCase_ = 0; + private java.lang.Object sourceCode_; + + public SourceCodeCase getSourceCodeCase() { + return SourceCodeCase.forNumber(sourceCodeCase_); + } + + public Builder clearSourceCode() { + sourceCodeCase_ = 0; + sourceCode_ = null; + onChanged(); + return this; + } + + private int triggerCase_ = 0; + private java.lang.Object trigger_; + + public TriggerCase getTriggerCase() { + return TriggerCase.forNumber(triggerCase_); + } + + public Builder clearTrigger() { + triggerCase_ = 0; + trigger_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+     * archive which contains the function.
+     * 
+ * + * string source_archive_url = 3; + * + * @return The sourceArchiveUrl. + */ + @java.lang.Override + public java.lang.String getSourceArchiveUrl() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 3) { + ref = sourceCode_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCodeCase_ == 3) { + sourceCode_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+     * archive which contains the function.
+     * 
+ * + * string source_archive_url = 3; + * + * @return The bytes for sourceArchiveUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceArchiveUrlBytes() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 3) { + ref = sourceCode_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCodeCase_ == 3) { + sourceCode_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+     * archive which contains the function.
+     * 
+ * + * string source_archive_url = 3; + * + * @param value The sourceArchiveUrl to set. + * @return This builder for chaining. + */ + public Builder setSourceArchiveUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCodeCase_ = 3; + sourceCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+     * archive which contains the function.
+     * 
+ * + * string source_archive_url = 3; + * + * @return This builder for chaining. + */ + public Builder clearSourceArchiveUrl() { + if (sourceCodeCase_ == 3) { + sourceCodeCase_ = 0; + sourceCode_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+     * archive which contains the function.
+     * 
+ * + * string source_archive_url = 3; + * + * @param value The bytes for sourceArchiveUrl to set. + * @return This builder for chaining. + */ + public Builder setSourceArchiveUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCodeCase_ = 3; + sourceCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.SourceRepository, + com.google.cloud.functions.v1.SourceRepository.Builder, + com.google.cloud.functions.v1.SourceRepositoryOrBuilder> + sourceRepositoryBuilder_; + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + * + * @return Whether the sourceRepository field is set. + */ + @java.lang.Override + public boolean hasSourceRepository() { + return sourceCodeCase_ == 4; + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + * + * @return The sourceRepository. + */ + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepository getSourceRepository() { + if (sourceRepositoryBuilder_ == null) { + if (sourceCodeCase_ == 4) { + return (com.google.cloud.functions.v1.SourceRepository) sourceCode_; + } + return com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } else { + if (sourceCodeCase_ == 4) { + return sourceRepositoryBuilder_.getMessage(); + } + return com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + public Builder setSourceRepository(com.google.cloud.functions.v1.SourceRepository value) { + if (sourceRepositoryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceCode_ = value; + onChanged(); + } else { + sourceRepositoryBuilder_.setMessage(value); + } + sourceCodeCase_ = 4; + return this; + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + public Builder setSourceRepository( + com.google.cloud.functions.v1.SourceRepository.Builder builderForValue) { + if (sourceRepositoryBuilder_ == null) { + sourceCode_ = builderForValue.build(); + onChanged(); + } else { + sourceRepositoryBuilder_.setMessage(builderForValue.build()); + } + sourceCodeCase_ = 4; + return this; + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + public Builder mergeSourceRepository(com.google.cloud.functions.v1.SourceRepository value) { + if (sourceRepositoryBuilder_ == null) { + if (sourceCodeCase_ == 4 + && sourceCode_ != com.google.cloud.functions.v1.SourceRepository.getDefaultInstance()) { + sourceCode_ = + com.google.cloud.functions.v1.SourceRepository.newBuilder( + (com.google.cloud.functions.v1.SourceRepository) sourceCode_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceCode_ = value; + } + onChanged(); + } else { + if (sourceCodeCase_ == 4) { + sourceRepositoryBuilder_.mergeFrom(value); + } + sourceRepositoryBuilder_.setMessage(value); + } + sourceCodeCase_ = 4; + return this; + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + public Builder clearSourceRepository() { + if (sourceRepositoryBuilder_ == null) { + if (sourceCodeCase_ == 4) { + sourceCodeCase_ = 0; + sourceCode_ = null; + onChanged(); + } + } else { + if (sourceCodeCase_ == 4) { + sourceCodeCase_ = 0; + sourceCode_ = null; + } + sourceRepositoryBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + public com.google.cloud.functions.v1.SourceRepository.Builder getSourceRepositoryBuilder() { + return getSourceRepositoryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepositoryOrBuilder getSourceRepositoryOrBuilder() { + if ((sourceCodeCase_ == 4) && (sourceRepositoryBuilder_ != null)) { + return sourceRepositoryBuilder_.getMessageOrBuilder(); + } else { + if (sourceCodeCase_ == 4) { + return (com.google.cloud.functions.v1.SourceRepository) sourceCode_; + } + return com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } + } + /** + * + * + *
+     * **Beta Feature**
+     * The source repository where a function is hosted.
+     * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.SourceRepository, + com.google.cloud.functions.v1.SourceRepository.Builder, + com.google.cloud.functions.v1.SourceRepositoryOrBuilder> + getSourceRepositoryFieldBuilder() { + if (sourceRepositoryBuilder_ == null) { + if (!(sourceCodeCase_ == 4)) { + sourceCode_ = com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } + sourceRepositoryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.SourceRepository, + com.google.cloud.functions.v1.SourceRepository.Builder, + com.google.cloud.functions.v1.SourceRepositoryOrBuilder>( + (com.google.cloud.functions.v1.SourceRepository) sourceCode_, + getParentForChildren(), + isClean()); + sourceCode_ = null; + } + sourceCodeCase_ = 4; + onChanged(); + ; + return sourceRepositoryBuilder_; + } + + /** + * + * + *
+     * The Google Cloud Storage signed URL used for source uploading, generated
+     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * 
+ * + * string source_upload_url = 16; + * + * @return The sourceUploadUrl. + */ + @java.lang.Override + public java.lang.String getSourceUploadUrl() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 16) { + ref = sourceCode_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (sourceCodeCase_ == 16) { + sourceCode_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Google Cloud Storage signed URL used for source uploading, generated
+     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * 
+ * + * string source_upload_url = 16; + * + * @return The bytes for sourceUploadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceUploadUrlBytes() { + java.lang.Object ref = ""; + if (sourceCodeCase_ == 16) { + ref = sourceCode_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (sourceCodeCase_ == 16) { + sourceCode_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Google Cloud Storage signed URL used for source uploading, generated
+     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * 
+ * + * string source_upload_url = 16; + * + * @param value The sourceUploadUrl to set. + * @return This builder for chaining. + */ + public Builder setSourceUploadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceCodeCase_ = 16; + sourceCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Google Cloud Storage signed URL used for source uploading, generated
+     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * 
+ * + * string source_upload_url = 16; + * + * @return This builder for chaining. + */ + public Builder clearSourceUploadUrl() { + if (sourceCodeCase_ == 16) { + sourceCodeCase_ = 0; + sourceCode_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The Google Cloud Storage signed URL used for source uploading, generated
+     * by [google.cloud.functions.v1.GenerateUploadUrl][]
+     * 
+ * + * string source_upload_url = 16; + * + * @param value The bytes for sourceUploadUrl to set. + * @return This builder for chaining. + */ + public Builder setSourceUploadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceCodeCase_ = 16; + sourceCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.HttpsTrigger, + com.google.cloud.functions.v1.HttpsTrigger.Builder, + com.google.cloud.functions.v1.HttpsTriggerOrBuilder> + httpsTriggerBuilder_; + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + * + * @return Whether the httpsTrigger field is set. + */ + @java.lang.Override + public boolean hasHttpsTrigger() { + return triggerCase_ == 5; + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + * + * @return The httpsTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTrigger getHttpsTrigger() { + if (httpsTriggerBuilder_ == null) { + if (triggerCase_ == 5) { + return (com.google.cloud.functions.v1.HttpsTrigger) trigger_; + } + return com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } else { + if (triggerCase_ == 5) { + return httpsTriggerBuilder_.getMessage(); + } + return com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + public Builder setHttpsTrigger(com.google.cloud.functions.v1.HttpsTrigger value) { + if (httpsTriggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trigger_ = value; + onChanged(); + } else { + httpsTriggerBuilder_.setMessage(value); + } + triggerCase_ = 5; + return this; + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + public Builder setHttpsTrigger( + com.google.cloud.functions.v1.HttpsTrigger.Builder builderForValue) { + if (httpsTriggerBuilder_ == null) { + trigger_ = builderForValue.build(); + onChanged(); + } else { + httpsTriggerBuilder_.setMessage(builderForValue.build()); + } + triggerCase_ = 5; + return this; + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + public Builder mergeHttpsTrigger(com.google.cloud.functions.v1.HttpsTrigger value) { + if (httpsTriggerBuilder_ == null) { + if (triggerCase_ == 5 + && trigger_ != com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance()) { + trigger_ = + com.google.cloud.functions.v1.HttpsTrigger.newBuilder( + (com.google.cloud.functions.v1.HttpsTrigger) trigger_) + .mergeFrom(value) + .buildPartial(); + } else { + trigger_ = value; + } + onChanged(); + } else { + if (triggerCase_ == 5) { + httpsTriggerBuilder_.mergeFrom(value); + } + httpsTriggerBuilder_.setMessage(value); + } + triggerCase_ = 5; + return this; + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + public Builder clearHttpsTrigger() { + if (httpsTriggerBuilder_ == null) { + if (triggerCase_ == 5) { + triggerCase_ = 0; + trigger_ = null; + onChanged(); + } + } else { + if (triggerCase_ == 5) { + triggerCase_ = 0; + trigger_ = null; + } + httpsTriggerBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + public com.google.cloud.functions.v1.HttpsTrigger.Builder getHttpsTriggerBuilder() { + return getHttpsTriggerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTriggerOrBuilder getHttpsTriggerOrBuilder() { + if ((triggerCase_ == 5) && (httpsTriggerBuilder_ != null)) { + return httpsTriggerBuilder_.getMessageOrBuilder(); + } else { + if (triggerCase_ == 5) { + return (com.google.cloud.functions.v1.HttpsTrigger) trigger_; + } + return com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } + } + /** + * + * + *
+     * An HTTPS endpoint type of source that can be triggered via URL.
+     * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.HttpsTrigger, + com.google.cloud.functions.v1.HttpsTrigger.Builder, + com.google.cloud.functions.v1.HttpsTriggerOrBuilder> + getHttpsTriggerFieldBuilder() { + if (httpsTriggerBuilder_ == null) { + if (!(triggerCase_ == 5)) { + trigger_ = com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } + httpsTriggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.HttpsTrigger, + com.google.cloud.functions.v1.HttpsTrigger.Builder, + com.google.cloud.functions.v1.HttpsTriggerOrBuilder>( + (com.google.cloud.functions.v1.HttpsTrigger) trigger_, + getParentForChildren(), + isClean()); + trigger_ = null; + } + triggerCase_ = 5; + onChanged(); + ; + return httpsTriggerBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.EventTrigger, + com.google.cloud.functions.v1.EventTrigger.Builder, + com.google.cloud.functions.v1.EventTriggerOrBuilder> + eventTriggerBuilder_; + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + * + * @return Whether the eventTrigger field is set. + */ + @java.lang.Override + public boolean hasEventTrigger() { + return triggerCase_ == 6; + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + * + * @return The eventTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v1.EventTrigger getEventTrigger() { + if (eventTriggerBuilder_ == null) { + if (triggerCase_ == 6) { + return (com.google.cloud.functions.v1.EventTrigger) trigger_; + } + return com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } else { + if (triggerCase_ == 6) { + return eventTriggerBuilder_.getMessage(); + } + return com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + public Builder setEventTrigger(com.google.cloud.functions.v1.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + trigger_ = value; + onChanged(); + } else { + eventTriggerBuilder_.setMessage(value); + } + triggerCase_ = 6; + return this; + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + public Builder setEventTrigger( + com.google.cloud.functions.v1.EventTrigger.Builder builderForValue) { + if (eventTriggerBuilder_ == null) { + trigger_ = builderForValue.build(); + onChanged(); + } else { + eventTriggerBuilder_.setMessage(builderForValue.build()); + } + triggerCase_ = 6; + return this; + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + public Builder mergeEventTrigger(com.google.cloud.functions.v1.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (triggerCase_ == 6 + && trigger_ != com.google.cloud.functions.v1.EventTrigger.getDefaultInstance()) { + trigger_ = + com.google.cloud.functions.v1.EventTrigger.newBuilder( + (com.google.cloud.functions.v1.EventTrigger) trigger_) + .mergeFrom(value) + .buildPartial(); + } else { + trigger_ = value; + } + onChanged(); + } else { + if (triggerCase_ == 6) { + eventTriggerBuilder_.mergeFrom(value); + } + eventTriggerBuilder_.setMessage(value); + } + triggerCase_ = 6; + return this; + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + public Builder clearEventTrigger() { + if (eventTriggerBuilder_ == null) { + if (triggerCase_ == 6) { + triggerCase_ = 0; + trigger_ = null; + onChanged(); + } + } else { + if (triggerCase_ == 6) { + triggerCase_ = 0; + trigger_ = null; + } + eventTriggerBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + public com.google.cloud.functions.v1.EventTrigger.Builder getEventTriggerBuilder() { + return getEventTriggerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v1.EventTriggerOrBuilder getEventTriggerOrBuilder() { + if ((triggerCase_ == 6) && (eventTriggerBuilder_ != null)) { + return eventTriggerBuilder_.getMessageOrBuilder(); + } else { + if (triggerCase_ == 6) { + return (com.google.cloud.functions.v1.EventTrigger) trigger_; + } + return com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } + } + /** + * + * + *
+     * A source that fires events in response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.EventTrigger, + com.google.cloud.functions.v1.EventTrigger.Builder, + com.google.cloud.functions.v1.EventTriggerOrBuilder> + getEventTriggerFieldBuilder() { + if (eventTriggerBuilder_ == null) { + if (!(triggerCase_ == 6)) { + trigger_ = com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } + eventTriggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.EventTrigger, + com.google.cloud.functions.v1.EventTrigger.Builder, + com.google.cloud.functions.v1.EventTriggerOrBuilder>( + (com.google.cloud.functions.v1.EventTrigger) trigger_, + getParentForChildren(), + isClean()); + trigger_ = null; + } + triggerCase_ = 6; + onChanged(); + ; + return eventTriggerBuilder_; + } + + private int status_ = 0; + /** + * + * + *
+     * Output only. Status of the function deployment.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + /** + * + * + *
+     * Output only. Status of the function deployment.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Status of the function deployment.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunctionStatus getStatus() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunctionStatus result = + com.google.cloud.functions.v1.CloudFunctionStatus.valueOf(status_); + return result == null + ? com.google.cloud.functions.v1.CloudFunctionStatus.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Status of the function deployment.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.cloud.functions.v1.CloudFunctionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Status of the function deployment.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + + private java.lang.Object entryPoint_ = ""; + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 8; + * + * @return The entryPoint. + */ + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 8; + * + * @return The bytes for entryPoint. + */ + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 8; + * + * @param value The entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entryPoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 8; + * + * @return This builder for chaining. + */ + public Builder clearEntryPoint() { + + entryPoint_ = getDefaultInstance().getEntryPoint(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 8; + * + * @param value The bytes for entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entryPoint_ = value; + onChanged(); + return this; + } + + private java.lang.Object runtime_ = ""; + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 19; + * + * @return The runtime. + */ + public java.lang.String getRuntime() { + java.lang.Object ref = runtime_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtime_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 19; + * + * @return The bytes for runtime. + */ + public com.google.protobuf.ByteString getRuntimeBytes() { + java.lang.Object ref = runtime_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 19; + * + * @param value The runtime to set. + * @return This builder for chaining. + */ + public Builder setRuntime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + runtime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 19; + * + * @return This builder for chaining. + */ + public Builder clearRuntime() { + + runtime_ = getDefaultInstance().getRuntime(); + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 19; + * + * @param value The bytes for runtime to set. + * @return This builder for chaining. + */ + public Builder setRuntimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + runtime_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Duration timeout_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + timeoutBuilder_; + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + * + * @return Whether the timeout field is set. + */ + public boolean hasTimeout() { + return timeoutBuilder_ != null || timeout_ != null; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + * + * @return The timeout. + */ + public com.google.protobuf.Duration getTimeout() { + if (timeoutBuilder_ == null) { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } else { + return timeoutBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + public Builder setTimeout(com.google.protobuf.Duration value) { + if (timeoutBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeout_ = value; + onChanged(); + } else { + timeoutBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + public Builder setTimeout(com.google.protobuf.Duration.Builder builderForValue) { + if (timeoutBuilder_ == null) { + timeout_ = builderForValue.build(); + onChanged(); + } else { + timeoutBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + public Builder mergeTimeout(com.google.protobuf.Duration value) { + if (timeoutBuilder_ == null) { + if (timeout_ != null) { + timeout_ = + com.google.protobuf.Duration.newBuilder(timeout_).mergeFrom(value).buildPartial(); + } else { + timeout_ = value; + } + onChanged(); + } else { + timeoutBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + public Builder clearTimeout() { + if (timeoutBuilder_ == null) { + timeout_ = null; + onChanged(); + } else { + timeout_ = null; + timeoutBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + public com.google.protobuf.Duration.Builder getTimeoutBuilder() { + + onChanged(); + return getTimeoutFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + public com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder() { + if (timeoutBuilder_ != null) { + return timeoutBuilder_.getMessageOrBuilder(); + } else { + return timeout_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeout_; + } + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getTimeoutFieldBuilder() { + if (timeoutBuilder_ == null) { + timeoutBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getTimeout(), getParentForChildren(), isClean()); + timeout_ = null; + } + return timeoutBuilder_; + } + + private int availableMemoryMb_; + /** + * + * + *
+     * The amount of memory in MB available for a function.
+     * Defaults to 256MB.
+     * 
+ * + * int32 available_memory_mb = 10; + * + * @return The availableMemoryMb. + */ + @java.lang.Override + public int getAvailableMemoryMb() { + return availableMemoryMb_; + } + /** + * + * + *
+     * The amount of memory in MB available for a function.
+     * Defaults to 256MB.
+     * 
+ * + * int32 available_memory_mb = 10; + * + * @param value The availableMemoryMb to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemoryMb(int value) { + + availableMemoryMb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory in MB available for a function.
+     * Defaults to 256MB.
+     * 
+ * + * int32 available_memory_mb = 10; + * + * @return This builder for chaining. + */ + public Builder clearAvailableMemoryMb() { + + availableMemoryMb_ = 0; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * The email of the function's service account. If empty, defaults to
+     * `{project_id}@appspot.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 11; + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The email of the function's service account. If empty, defaults to
+     * `{project_id}@appspot.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 11; + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The email of the function's service account. If empty, defaults to
+     * `{project_id}@appspot.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 11; + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the function's service account. If empty, defaults to
+     * `{project_id}@appspot.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 11; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the function's service account. If empty, defaults to
+     * `{project_id}@appspot.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 11; + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private long versionId_; + /** + * + * + *
+     * Output only. The version identifier of the Cloud Function. Each deployment attempt
+     * results in a new version of a function being created.
+     * 
+ * + * int64 version_id = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The versionId. + */ + @java.lang.Override + public long getVersionId() { + return versionId_; + } + /** + * + * + *
+     * Output only. The version identifier of the Cloud Function. Each deployment attempt
+     * results in a new version of a function being created.
+     * 
+ * + * int64 version_id = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionId(long value) { + + versionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version identifier of the Cloud Function. Each deployment attempt
+     * results in a new version of a function being created.
+     * 
+ * + * int64 version_id = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearVersionId() { + + versionId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + private com.google.protobuf.MapField + internalGetMutableEnvironmentVariables() { + onChanged(); + ; + if (environmentVariables_ == null) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + if (!environmentVariables_.isMutable()) { + environmentVariables_ = environmentVariables_.copy(); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEnvironmentVariables() { + internalGetMutableEnvironmentVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableEnvironmentVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnvironmentVariables() { + return internalGetMutableEnvironmentVariables().getMutableMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 17; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The VPC Network that this cloud function can connect to. It can be
+     * either the fully-qualified URI, or the short name of the network resource.
+     * If the short network name is used, the network must belong to the same
+     * project. Otherwise, it must belong to a project within the same
+     * organization. The format of this field is either
+     * `projects/{project}/global/networks/{network}` or `{network}`, where
+     * {project} is a project id where the network is defined, and {network} is
+     * the short name of the network.
+     * This field is mutually exclusive with `vpc_connector` and will be replaced
+     * by it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string network = 18; + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The VPC Network that this cloud function can connect to. It can be
+     * either the fully-qualified URI, or the short name of the network resource.
+     * If the short network name is used, the network must belong to the same
+     * project. Otherwise, it must belong to a project within the same
+     * organization. The format of this field is either
+     * `projects/{project}/global/networks/{network}` or `{network}`, where
+     * {project} is a project id where the network is defined, and {network} is
+     * the short name of the network.
+     * This field is mutually exclusive with `vpc_connector` and will be replaced
+     * by it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string network = 18; + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The VPC Network that this cloud function can connect to. It can be
+     * either the fully-qualified URI, or the short name of the network resource.
+     * If the short network name is used, the network must belong to the same
+     * project. Otherwise, it must belong to a project within the same
+     * organization. The format of this field is either
+     * `projects/{project}/global/networks/{network}` or `{network}`, where
+     * {project} is a project id where the network is defined, and {network} is
+     * the short name of the network.
+     * This field is mutually exclusive with `vpc_connector` and will be replaced
+     * by it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string network = 18; + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + network_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The VPC Network that this cloud function can connect to. It can be
+     * either the fully-qualified URI, or the short name of the network resource.
+     * If the short network name is used, the network must belong to the same
+     * project. Otherwise, it must belong to a project within the same
+     * organization. The format of this field is either
+     * `projects/{project}/global/networks/{network}` or `{network}`, where
+     * {project} is a project id where the network is defined, and {network} is
+     * the short name of the network.
+     * This field is mutually exclusive with `vpc_connector` and will be replaced
+     * by it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string network = 18; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + + network_ = getDefaultInstance().getNetwork(); + onChanged(); + return this; + } + /** + * + * + *
+     * The VPC Network that this cloud function can connect to. It can be
+     * either the fully-qualified URI, or the short name of the network resource.
+     * If the short network name is used, the network must belong to the same
+     * project. Otherwise, it must belong to a project within the same
+     * organization. The format of this field is either
+     * `projects/{project}/global/networks/{network}` or `{network}`, where
+     * {project} is a project id where the network is defined, and {network} is
+     * the short name of the network.
+     * This field is mutually exclusive with `vpc_connector` and will be replaced
+     * by it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string network = 18; + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + network_ = value; + onChanged(); + return this; + } + + private int maxInstances_; + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * 
+ * + * int32 max_instances = 20; + * + * @return The maxInstances. + */ + @java.lang.Override + public int getMaxInstances() { + return maxInstances_; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * 
+ * + * int32 max_instances = 20; + * + * @param value The maxInstances to set. + * @return This builder for chaining. + */ + public Builder setMaxInstances(int value) { + + maxInstances_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * 
+ * + * int32 max_instances = 20; + * + * @return This builder for chaining. + */ + public Builder clearMaxInstances() { + + maxInstances_ = 0; + onChanged(); + return this; + } + + private java.lang.Object vpcConnector_ = ""; + /** + * + * + *
+     * The VPC Network Connector that this cloud function can connect to. It can
+     * be either the fully-qualified URI, or the short name of the network
+     * connector resource. The format of this field is
+     * `projects/*/locations/*/connectors/*`
+     * This field is mutually exclusive with `network` field and will eventually
+     * replace it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string vpc_connector = 22; + * + * @return The vpcConnector. + */ + public java.lang.String getVpcConnector() { + java.lang.Object ref = vpcConnector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vpcConnector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The VPC Network Connector that this cloud function can connect to. It can
+     * be either the fully-qualified URI, or the short name of the network
+     * connector resource. The format of this field is
+     * `projects/*/locations/*/connectors/*`
+     * This field is mutually exclusive with `network` field and will eventually
+     * replace it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string vpc_connector = 22; + * + * @return The bytes for vpcConnector. + */ + public com.google.protobuf.ByteString getVpcConnectorBytes() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vpcConnector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The VPC Network Connector that this cloud function can connect to. It can
+     * be either the fully-qualified URI, or the short name of the network
+     * connector resource. The format of this field is
+     * `projects/*/locations/*/connectors/*`
+     * This field is mutually exclusive with `network` field and will eventually
+     * replace it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string vpc_connector = 22; + * + * @param value The vpcConnector to set. + * @return This builder for chaining. + */ + public Builder setVpcConnector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + vpcConnector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The VPC Network Connector that this cloud function can connect to. It can
+     * be either the fully-qualified URI, or the short name of the network
+     * connector resource. The format of this field is
+     * `projects/*/locations/*/connectors/*`
+     * This field is mutually exclusive with `network` field and will eventually
+     * replace it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string vpc_connector = 22; + * + * @return This builder for chaining. + */ + public Builder clearVpcConnector() { + + vpcConnector_ = getDefaultInstance().getVpcConnector(); + onChanged(); + return this; + } + /** + * + * + *
+     * The VPC Network Connector that this cloud function can connect to. It can
+     * be either the fully-qualified URI, or the short name of the network
+     * connector resource. The format of this field is
+     * `projects/*/locations/*/connectors/*`
+     * This field is mutually exclusive with `network` field and will eventually
+     * replace it.
+     * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+     * more information on connecting Cloud projects.
+     * 
+ * + * string vpc_connector = 22; + * + * @param value The bytes for vpcConnector to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + vpcConnector_ = value; + onChanged(); + return this; + } + + private int vpcConnectorEgressSettings_ = 0; + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + @java.lang.Override + public int getVpcConnectorEgressSettingsValue() { + return vpcConnectorEgressSettings_; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @param value The enum numeric value on the wire for vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettingsValue(int value) { + + vpcConnectorEgressSettings_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings result = + com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @param value The vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettings( + com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings value) { + if (value == null) { + throw new NullPointerException(); + } + + vpcConnectorEgressSettings_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return This builder for chaining. + */ + public Builder clearVpcConnectorEgressSettings() { + + vpcConnectorEgressSettings_ = 0; + onChanged(); + return this; + } + + private int ingressSettings_ = 0; + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return The enum numeric value on the wire for ingressSettings. + */ + @java.lang.Override + public int getIngressSettingsValue() { + return ingressSettings_; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @param value The enum numeric value on the wire for ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettingsValue(int value) { + + ingressSettings_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunction.IngressSettings result = + com.google.cloud.functions.v1.CloudFunction.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v1.CloudFunction.IngressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @param value The ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettings( + com.google.cloud.functions.v1.CloudFunction.IngressSettings value) { + if (value == null) { + throw new NullPointerException(); + } + + ingressSettings_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return This builder for chaining. + */ + public Builder clearIngressSettings() { + + ingressSettings_ = 0; + onChanged(); + return this; + } + + private java.lang.Object buildId_ = ""; + /** + * + * + *
+     * Output only. The Cloud Build ID of the latest successful deployment of the
+     * function.
+     * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The buildId. + */ + public java.lang.String getBuildId() { + java.lang.Object ref = buildId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + buildId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build ID of the latest successful deployment of the
+     * function.
+     * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for buildId. + */ + public com.google.protobuf.ByteString getBuildIdBytes() { + java.lang.Object ref = buildId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build ID of the latest successful deployment of the
+     * function.
+     * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The buildId to set. + * @return This builder for chaining. + */ + public Builder setBuildId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + buildId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build ID of the latest successful deployment of the
+     * function.
+     * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBuildId() { + + buildId_ = getDefaultInstance().getBuildId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build ID of the latest successful deployment of the
+     * function.
+     * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for buildId to set. + * @return This builder for chaining. + */ + public Builder setBuildIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + buildId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.CloudFunction) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.CloudFunction) + private static final com.google.cloud.functions.v1.CloudFunction DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.CloudFunction(); + } + + public static com.google.cloud.functions.v1.CloudFunction getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudFunction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudFunction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionName.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionName.java new file mode 100644 index 00000000..c4334f08 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionName.java @@ -0,0 +1,211 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class CloudFunctionName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/functions/{function}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String function; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFunction() { + return function; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private CloudFunctionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + function = Preconditions.checkNotNull(builder.getFunction()); + } + + public static CloudFunctionName of(String project, String location, String function) { + return newBuilder().setProject(project).setLocation(location).setFunction(function).build(); + } + + public static String format(String project, String location, String function) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setFunction(function) + .build() + .toString(); + } + + public static CloudFunctionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "CloudFunctionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("function")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (CloudFunctionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("function", function); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "location", location, "function", function); + } + + /** Builder for CloudFunctionName. */ + public static class Builder { + + private String project; + private String location; + private String function; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFunction() { + return function; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFunction(String function) { + this.function = function; + return this; + } + + private Builder() {} + + private Builder(CloudFunctionName cloudFunctionName) { + project = cloudFunctionName.project; + location = cloudFunctionName.location; + function = cloudFunctionName.function; + } + + public CloudFunctionName build() { + return new CloudFunctionName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof CloudFunctionName) { + CloudFunctionName that = (CloudFunctionName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.function.equals(that.function)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= function.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java new file mode 100644 index 00000000..705bff79 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java @@ -0,0 +1,769 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface CloudFunctionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.CloudFunction) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+   * archive which contains the function.
+   * 
+ * + * string source_archive_url = 3; + * + * @return The sourceArchiveUrl. + */ + java.lang.String getSourceArchiveUrl(); + /** + * + * + *
+   * The Google Cloud Storage URL, starting with gs://, pointing to the zip
+   * archive which contains the function.
+   * 
+ * + * string source_archive_url = 3; + * + * @return The bytes for sourceArchiveUrl. + */ + com.google.protobuf.ByteString getSourceArchiveUrlBytes(); + + /** + * + * + *
+   * **Beta Feature**
+   * The source repository where a function is hosted.
+   * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + * + * @return Whether the sourceRepository field is set. + */ + boolean hasSourceRepository(); + /** + * + * + *
+   * **Beta Feature**
+   * The source repository where a function is hosted.
+   * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + * + * @return The sourceRepository. + */ + com.google.cloud.functions.v1.SourceRepository getSourceRepository(); + /** + * + * + *
+   * **Beta Feature**
+   * The source repository where a function is hosted.
+   * 
+ * + * .google.cloud.functions.v1.SourceRepository source_repository = 4; + */ + com.google.cloud.functions.v1.SourceRepositoryOrBuilder getSourceRepositoryOrBuilder(); + + /** + * + * + *
+   * The Google Cloud Storage signed URL used for source uploading, generated
+   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * 
+ * + * string source_upload_url = 16; + * + * @return The sourceUploadUrl. + */ + java.lang.String getSourceUploadUrl(); + /** + * + * + *
+   * The Google Cloud Storage signed URL used for source uploading, generated
+   * by [google.cloud.functions.v1.GenerateUploadUrl][]
+   * 
+ * + * string source_upload_url = 16; + * + * @return The bytes for sourceUploadUrl. + */ + com.google.protobuf.ByteString getSourceUploadUrlBytes(); + + /** + * + * + *
+   * An HTTPS endpoint type of source that can be triggered via URL.
+   * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + * + * @return Whether the httpsTrigger field is set. + */ + boolean hasHttpsTrigger(); + /** + * + * + *
+   * An HTTPS endpoint type of source that can be triggered via URL.
+   * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + * + * @return The httpsTrigger. + */ + com.google.cloud.functions.v1.HttpsTrigger getHttpsTrigger(); + /** + * + * + *
+   * An HTTPS endpoint type of source that can be triggered via URL.
+   * 
+ * + * .google.cloud.functions.v1.HttpsTrigger https_trigger = 5; + */ + com.google.cloud.functions.v1.HttpsTriggerOrBuilder getHttpsTriggerOrBuilder(); + + /** + * + * + *
+   * A source that fires events in response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + * + * @return Whether the eventTrigger field is set. + */ + boolean hasEventTrigger(); + /** + * + * + *
+   * A source that fires events in response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + * + * @return The eventTrigger. + */ + com.google.cloud.functions.v1.EventTrigger getEventTrigger(); + /** + * + * + *
+   * A source that fires events in response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v1.EventTrigger event_trigger = 6; + */ + com.google.cloud.functions.v1.EventTriggerOrBuilder getEventTriggerOrBuilder(); + + /** + * + * + *
+   * Output only. Status of the function deployment.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * + * + *
+   * Output only. Status of the function deployment.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The status. + */ + com.google.cloud.functions.v1.CloudFunctionStatus getStatus(); + + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 8; + * + * @return The entryPoint. + */ + java.lang.String getEntryPoint(); + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 8; + * + * @return The bytes for entryPoint. + */ + com.google.protobuf.ByteString getEntryPointBytes(); + + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 19; + * + * @return The runtime. + */ + java.lang.String getRuntime(); + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 19; + * + * @return The bytes for runtime. + */ + com.google.protobuf.ByteString getRuntimeBytes(); + + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 9; + * + * @return Whether the timeout field is set. + */ + boolean hasTimeout(); + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 9; + * + * @return The timeout. + */ + com.google.protobuf.Duration getTimeout(); + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * .google.protobuf.Duration timeout = 9; + */ + com.google.protobuf.DurationOrBuilder getTimeoutOrBuilder(); + + /** + * + * + *
+   * The amount of memory in MB available for a function.
+   * Defaults to 256MB.
+   * 
+ * + * int32 available_memory_mb = 10; + * + * @return The availableMemoryMb. + */ + int getAvailableMemoryMb(); + + /** + * + * + *
+   * The email of the function's service account. If empty, defaults to
+   * `{project_id}@appspot.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 11; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * The email of the function's service account. If empty, defaults to
+   * `{project_id}@appspot.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 11; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The version identifier of the Cloud Function. Each deployment attempt
+   * results in a new version of a function being created.
+   * 
+ * + * int64 version_id = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The versionId. + */ + long getVersionId(); + + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + boolean containsEnvironmentVariables(java.lang.String key); + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnvironmentVariables(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 17; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The VPC Network that this cloud function can connect to. It can be
+   * either the fully-qualified URI, or the short name of the network resource.
+   * If the short network name is used, the network must belong to the same
+   * project. Otherwise, it must belong to a project within the same
+   * organization. The format of this field is either
+   * `projects/{project}/global/networks/{network}` or `{network}`, where
+   * {project} is a project id where the network is defined, and {network} is
+   * the short name of the network.
+   * This field is mutually exclusive with `vpc_connector` and will be replaced
+   * by it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string network = 18; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The VPC Network that this cloud function can connect to. It can be
+   * either the fully-qualified URI, or the short name of the network resource.
+   * If the short network name is used, the network must belong to the same
+   * project. Otherwise, it must belong to a project within the same
+   * organization. The format of this field is either
+   * `projects/{project}/global/networks/{network}` or `{network}`, where
+   * {project} is a project id where the network is defined, and {network} is
+   * the short name of the network.
+   * This field is mutually exclusive with `vpc_connector` and will be replaced
+   * by it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string network = 18; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * 
+ * + * int32 max_instances = 20; + * + * @return The maxInstances. + */ + int getMaxInstances(); + + /** + * + * + *
+   * The VPC Network Connector that this cloud function can connect to. It can
+   * be either the fully-qualified URI, or the short name of the network
+   * connector resource. The format of this field is
+   * `projects/*/locations/*/connectors/*`
+   * This field is mutually exclusive with `network` field and will eventually
+   * replace it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string vpc_connector = 22; + * + * @return The vpcConnector. + */ + java.lang.String getVpcConnector(); + /** + * + * + *
+   * The VPC Network Connector that this cloud function can connect to. It can
+   * be either the fully-qualified URI, or the short name of the network
+   * connector resource. The format of this field is
+   * `projects/*/locations/*/connectors/*`
+   * This field is mutually exclusive with `network` field and will eventually
+   * replace it.
+   * See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for
+   * more information on connecting Cloud projects.
+   * 
+ * + * string vpc_connector = 22; + * + * @return The bytes for vpcConnector. + */ + com.google.protobuf.ByteString getVpcConnectorBytes(); + + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + int getVpcConnectorEgressSettingsValue(); + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + * + * + * @return The vpcConnectorEgressSettings. + */ + com.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings + getVpcConnectorEgressSettings(); + + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return The enum numeric value on the wire for ingressSettings. + */ + int getIngressSettingsValue(); + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24; + * + * @return The ingressSettings. + */ + com.google.cloud.functions.v1.CloudFunction.IngressSettings getIngressSettings(); + + /** + * + * + *
+   * Output only. The Cloud Build ID of the latest successful deployment of the
+   * function.
+   * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The buildId. + */ + java.lang.String getBuildId(); + /** + * + * + *
+   * Output only. The Cloud Build ID of the latest successful deployment of the
+   * function.
+   * 
+ * + * string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for buildId. + */ + com.google.protobuf.ByteString getBuildIdBytes(); + + public com.google.cloud.functions.v1.CloudFunction.SourceCodeCase getSourceCodeCase(); + + public com.google.cloud.functions.v1.CloudFunction.TriggerCase getTriggerCase(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionStatus.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionStatus.java new file mode 100644 index 00000000..fcca5fb1 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionStatus.java @@ -0,0 +1,247 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Describes the current stage of a deployment.
+ * 
+ * + * Protobuf enum {@code google.cloud.functions.v1.CloudFunctionStatus} + */ +public enum CloudFunctionStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified. Invalid state.
+   * 
+ * + * CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0; + */ + CLOUD_FUNCTION_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * Function has been successfully deployed and is serving.
+   * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+   * Function deployment failed and the function isn’t serving.
+   * 
+ * + * OFFLINE = 2; + */ + OFFLINE(2), + /** + * + * + *
+   * Function is being created or updated.
+   * 
+ * + * DEPLOY_IN_PROGRESS = 3; + */ + DEPLOY_IN_PROGRESS(3), + /** + * + * + *
+   * Function is being deleted.
+   * 
+ * + * DELETE_IN_PROGRESS = 4; + */ + DELETE_IN_PROGRESS(4), + /** + * + * + *
+   * Function deployment failed and the function serving state is undefined.
+   * The function should be updated or deleted to move it out of this state.
+   * 
+ * + * UNKNOWN = 5; + */ + UNKNOWN(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified. Invalid state.
+   * 
+ * + * CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0; + */ + public static final int CLOUD_FUNCTION_STATUS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Function has been successfully deployed and is serving.
+   * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+   * Function deployment failed and the function isn’t serving.
+   * 
+ * + * OFFLINE = 2; + */ + public static final int OFFLINE_VALUE = 2; + /** + * + * + *
+   * Function is being created or updated.
+   * 
+ * + * DEPLOY_IN_PROGRESS = 3; + */ + public static final int DEPLOY_IN_PROGRESS_VALUE = 3; + /** + * + * + *
+   * Function is being deleted.
+   * 
+ * + * DELETE_IN_PROGRESS = 4; + */ + public static final int DELETE_IN_PROGRESS_VALUE = 4; + /** + * + * + *
+   * Function deployment failed and the function serving state is undefined.
+   * The function should be updated or deleted to move it out of this state.
+   * 
+ * + * UNKNOWN = 5; + */ + public static final int UNKNOWN_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CloudFunctionStatus valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static CloudFunctionStatus forNumber(int value) { + switch (value) { + case 0: + return CLOUD_FUNCTION_STATUS_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return OFFLINE; + case 3: + return DEPLOY_IN_PROGRESS; + case 4: + return DELETE_IN_PROGRESS; + case 5: + return UNKNOWN; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CloudFunctionStatus findValueByNumber(int number) { + return CloudFunctionStatus.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final CloudFunctionStatus[] VALUES = values(); + + public static CloudFunctionStatus valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private CloudFunctionStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v1.CloudFunctionStatus) +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CreateFunctionRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CreateFunctionRequest.java new file mode 100644 index 00000000..32fddd68 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CreateFunctionRequest.java @@ -0,0 +1,959 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request for the `CreateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CreateFunctionRequest} + */ +public final class CreateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.CreateFunctionRequest) + CreateFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFunctionRequest.newBuilder() to construct. + private CreateFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFunctionRequest() { + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + location_ = s; + break; + } + case 18: + { + com.google.cloud.functions.v1.CloudFunction.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v1.CloudFunction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CreateFunctionRequest.class, + com.google.cloud.functions.v1.CreateFunctionRequest.Builder.class); + } + + public static final int LOCATION_FIELD_NUMBER = 1; + private volatile java.lang.Object location_; + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FUNCTION_FIELD_NUMBER = 2; + private com.google.cloud.functions.v1.CloudFunction function_; + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return function_ != null; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction getFunction() { + return function_ == null + ? com.google.cloud.functions.v1.CloudFunction.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getLocationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); + } + if (function_ != null) { + output.writeMessage(2, getFunction()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLocationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); + } + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFunction()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.CreateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.CreateFunctionRequest other = + (com.google.cloud.functions.v1.CreateFunctionRequest) obj; + + if (!getLocation().equals(other.getLocation())) return false; + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.CreateFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `CreateFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.CreateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.CreateFunctionRequest) + com.google.cloud.functions.v1.CreateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.CreateFunctionRequest.class, + com.google.cloud.functions.v1.CreateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.CreateFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + location_ = ""; + + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CreateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.CreateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.CreateFunctionRequest build() { + com.google.cloud.functions.v1.CreateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CreateFunctionRequest buildPartial() { + com.google.cloud.functions.v1.CreateFunctionRequest result = + new com.google.cloud.functions.v1.CreateFunctionRequest(this); + result.location_ = location_; + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.CreateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v1.CreateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.CreateFunctionRequest other) { + if (other == com.google.cloud.functions.v1.CreateFunctionRequest.getDefaultInstance()) + return this; + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.CreateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.CreateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v1.CloudFunction function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v1.CloudFunction getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v1.CloudFunction.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v1.CloudFunction value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction( + com.google.cloud.functions.v1.CloudFunction.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v1.CloudFunction value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v1.CloudFunction.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = null; + onChanged(); + } else { + function_ = null; + functionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v1.CloudFunction.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v1.CloudFunction.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.CreateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.CreateFunctionRequest) + private static final com.google.cloud.functions.v1.CreateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.CreateFunctionRequest(); + } + + public static com.google.cloud.functions.v1.CreateFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.CreateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CreateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CreateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..af0e14ef --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CreateFunctionRequestOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface CreateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.CreateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string location = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v1.CloudFunction getFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/DeleteFunctionRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/DeleteFunctionRequest.java new file mode 100644 index 00000000..30de42bd --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/DeleteFunctionRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request for the `DeleteFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.DeleteFunctionRequest} + */ +public final class DeleteFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.DeleteFunctionRequest) + DeleteFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFunctionRequest.newBuilder() to construct. + private DeleteFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFunctionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.DeleteFunctionRequest.class, + com.google.cloud.functions.v1.DeleteFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.DeleteFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.DeleteFunctionRequest other = + (com.google.cloud.functions.v1.DeleteFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.DeleteFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `DeleteFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.DeleteFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.DeleteFunctionRequest) + com.google.cloud.functions.v1.DeleteFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.DeleteFunctionRequest.class, + com.google.cloud.functions.v1.DeleteFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.DeleteFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.DeleteFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.DeleteFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.DeleteFunctionRequest build() { + com.google.cloud.functions.v1.DeleteFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.DeleteFunctionRequest buildPartial() { + com.google.cloud.functions.v1.DeleteFunctionRequest result = + new com.google.cloud.functions.v1.DeleteFunctionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.DeleteFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v1.DeleteFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.DeleteFunctionRequest other) { + if (other == com.google.cloud.functions.v1.DeleteFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.DeleteFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.DeleteFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.DeleteFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.DeleteFunctionRequest) + private static final com.google.cloud.functions.v1.DeleteFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.DeleteFunctionRequest(); + } + + public static com.google.cloud.functions.v1.DeleteFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.DeleteFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/DeleteFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/DeleteFunctionRequestOrBuilder.java new file mode 100644 index 00000000..fe29335b --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/DeleteFunctionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface DeleteFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.DeleteFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/EventTrigger.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/EventTrigger.java new file mode 100644 index 00000000..ac06c038 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/EventTrigger.java @@ -0,0 +1,1468 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Describes EventTrigger, used to request events be sent from another
+ * service.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.EventTrigger} + */ +public final class EventTrigger extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.EventTrigger) + EventTriggerOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventTrigger.newBuilder() to construct. + private EventTrigger(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventTrigger() { + eventType_ = ""; + resource_ = ""; + service_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventTrigger(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventTrigger( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + eventType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + resource_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + service_ = s; + break; + } + case 42: + { + com.google.cloud.functions.v1.FailurePolicy.Builder subBuilder = null; + if (failurePolicy_ != null) { + subBuilder = failurePolicy_.toBuilder(); + } + failurePolicy_ = + input.readMessage( + com.google.cloud.functions.v1.FailurePolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(failurePolicy_); + failurePolicy_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.EventTrigger.class, + com.google.cloud.functions.v1.EventTrigger.Builder.class); + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `providers/cloud.storage/eventTypes/object.change` and
+   * `providers/cloud.pubsub/eventTypes/topic.publish`.
+   * Event types match pattern `providers/*/eventTypes/*.*`.
+   * The pattern contains:
+   * 1. namespace: For example, `cloud.storage` and
+   *    `google.firebase.analytics`.
+   * 2. resource type: The type of resource on which event occurs. For
+   *    example, the Google Cloud Storage API includes the type `object`.
+   * 3. action: The action that generates the event. For example, action for
+   *    a Google Cloud Storage Object is 'change'.
+   * These parts are lower case.
+   * 
+ * + * string event_type = 1; + * + * @return The eventType. + */ + @java.lang.Override + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `providers/cloud.storage/eventTypes/object.change` and
+   * `providers/cloud.pubsub/eventTypes/topic.publish`.
+   * Event types match pattern `providers/*/eventTypes/*.*`.
+   * The pattern contains:
+   * 1. namespace: For example, `cloud.storage` and
+   *    `google.firebase.analytics`.
+   * 2. resource type: The type of resource on which event occurs. For
+   *    example, the Google Cloud Storage API includes the type `object`.
+   * 3. action: The action that generates the event. For example, action for
+   *    a Google Cloud Storage Object is 'change'.
+   * These parts are lower case.
+   * 
+ * + * string event_type = 1; + * + * @return The bytes for eventType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Required. The resource(s) from which to observe events, for example,
+   * `projects/_/buckets/myBucket`.
+   * Not all syntactically correct values are accepted by all services. For
+   * example:
+   * 1. The authorization model must support it. Google Cloud Functions
+   *    only allows EventTriggers to be deployed that observe resources in the
+   *    same project as the `CloudFunction`.
+   * 2. The resource type must match the pattern expected for an
+   *    `event_type`. For example, an `EventTrigger` that has an
+   *    `event_type` of "google.pubsub.topic.publish" should have a resource
+   *    that matches Google Cloud Pub/Sub topics.
+   * Additionally, some services may support short names when creating an
+   * `EventTrigger`. These will always be returned in the normalized "long"
+   * format.
+   * See each *service's* documentation for supported formats.
+   * 
+ * + * string resource = 2; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource(s) from which to observe events, for example,
+   * `projects/_/buckets/myBucket`.
+   * Not all syntactically correct values are accepted by all services. For
+   * example:
+   * 1. The authorization model must support it. Google Cloud Functions
+   *    only allows EventTriggers to be deployed that observe resources in the
+   *    same project as the `CloudFunction`.
+   * 2. The resource type must match the pattern expected for an
+   *    `event_type`. For example, an `EventTrigger` that has an
+   *    `event_type` of "google.pubsub.topic.publish" should have a resource
+   *    that matches Google Cloud Pub/Sub topics.
+   * Additionally, some services may support short names when creating an
+   * `EventTrigger`. These will always be returned in the normalized "long"
+   * format.
+   * See each *service's* documentation for supported formats.
+   * 
+ * + * string resource = 2; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_FIELD_NUMBER = 3; + private volatile java.lang.Object service_; + /** + * + * + *
+   * The hostname of the service that should be observed.
+   * If no string is provided, the default service implementing the API will
+   * be used. For example, `storage.googleapis.com` is the default for all
+   * event types in the `google.storage` namespace.
+   * 
+ * + * string service = 3; + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * The hostname of the service that should be observed.
+   * If no string is provided, the default service implementing the API will
+   * be used. For example, `storage.googleapis.com` is the default for all
+   * event types in the `google.storage` namespace.
+   * 
+ * + * string service = 3; + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FAILURE_POLICY_FIELD_NUMBER = 5; + private com.google.cloud.functions.v1.FailurePolicy failurePolicy_; + /** + * + * + *
+   * Specifies policy for failed executions.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + * + * @return Whether the failurePolicy field is set. + */ + @java.lang.Override + public boolean hasFailurePolicy() { + return failurePolicy_ != null; + } + /** + * + * + *
+   * Specifies policy for failed executions.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + * + * @return The failurePolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy getFailurePolicy() { + return failurePolicy_ == null + ? com.google.cloud.functions.v1.FailurePolicy.getDefaultInstance() + : failurePolicy_; + } + /** + * + * + *
+   * Specifies policy for failed executions.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicyOrBuilder getFailurePolicyOrBuilder() { + return getFailurePolicy(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getEventTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, eventType_); + } + if (!getResourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resource_); + } + if (!getServiceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, service_); + } + if (failurePolicy_ != null) { + output.writeMessage(5, getFailurePolicy()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEventTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, eventType_); + } + if (!getResourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resource_); + } + if (!getServiceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, service_); + } + if (failurePolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getFailurePolicy()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.EventTrigger)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.EventTrigger other = + (com.google.cloud.functions.v1.EventTrigger) obj; + + if (!getEventType().equals(other.getEventType())) return false; + if (!getResource().equals(other.getResource())) return false; + if (!getService().equals(other.getService())) return false; + if (hasFailurePolicy() != other.hasFailurePolicy()) return false; + if (hasFailurePolicy()) { + if (!getFailurePolicy().equals(other.getFailurePolicy())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + if (hasFailurePolicy()) { + hash = (37 * hash) + FAILURE_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getFailurePolicy().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.EventTrigger parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.EventTrigger parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.EventTrigger parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.EventTrigger prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes EventTrigger, used to request events be sent from another
+   * service.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.EventTrigger} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.EventTrigger) + com.google.cloud.functions.v1.EventTriggerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.EventTrigger.class, + com.google.cloud.functions.v1.EventTrigger.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.EventTrigger.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + eventType_ = ""; + + resource_ = ""; + + service_ = ""; + + if (failurePolicyBuilder_ == null) { + failurePolicy_ = null; + } else { + failurePolicy_ = null; + failurePolicyBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_EventTrigger_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.EventTrigger getDefaultInstanceForType() { + return com.google.cloud.functions.v1.EventTrigger.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.EventTrigger build() { + com.google.cloud.functions.v1.EventTrigger result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.EventTrigger buildPartial() { + com.google.cloud.functions.v1.EventTrigger result = + new com.google.cloud.functions.v1.EventTrigger(this); + result.eventType_ = eventType_; + result.resource_ = resource_; + result.service_ = service_; + if (failurePolicyBuilder_ == null) { + result.failurePolicy_ = failurePolicy_; + } else { + result.failurePolicy_ = failurePolicyBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.EventTrigger) { + return mergeFrom((com.google.cloud.functions.v1.EventTrigger) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.EventTrigger other) { + if (other == com.google.cloud.functions.v1.EventTrigger.getDefaultInstance()) return this; + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getService().isEmpty()) { + service_ = other.service_; + onChanged(); + } + if (other.hasFailurePolicy()) { + mergeFailurePolicy(other.getFailurePolicy()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.EventTrigger parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v1.EventTrigger) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `providers/cloud.storage/eventTypes/object.change` and
+     * `providers/cloud.pubsub/eventTypes/topic.publish`.
+     * Event types match pattern `providers/*/eventTypes/*.*`.
+     * The pattern contains:
+     * 1. namespace: For example, `cloud.storage` and
+     *    `google.firebase.analytics`.
+     * 2. resource type: The type of resource on which event occurs. For
+     *    example, the Google Cloud Storage API includes the type `object`.
+     * 3. action: The action that generates the event. For example, action for
+     *    a Google Cloud Storage Object is 'change'.
+     * These parts are lower case.
+     * 
+ * + * string event_type = 1; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `providers/cloud.storage/eventTypes/object.change` and
+     * `providers/cloud.pubsub/eventTypes/topic.publish`.
+     * Event types match pattern `providers/*/eventTypes/*.*`.
+     * The pattern contains:
+     * 1. namespace: For example, `cloud.storage` and
+     *    `google.firebase.analytics`.
+     * 2. resource type: The type of resource on which event occurs. For
+     *    example, the Google Cloud Storage API includes the type `object`.
+     * 3. action: The action that generates the event. For example, action for
+     *    a Google Cloud Storage Object is 'change'.
+     * These parts are lower case.
+     * 
+ * + * string event_type = 1; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `providers/cloud.storage/eventTypes/object.change` and
+     * `providers/cloud.pubsub/eventTypes/topic.publish`.
+     * Event types match pattern `providers/*/eventTypes/*.*`.
+     * The pattern contains:
+     * 1. namespace: For example, `cloud.storage` and
+     *    `google.firebase.analytics`.
+     * 2. resource type: The type of resource on which event occurs. For
+     *    example, the Google Cloud Storage API includes the type `object`.
+     * 3. action: The action that generates the event. For example, action for
+     *    a Google Cloud Storage Object is 'change'.
+     * These parts are lower case.
+     * 
+ * + * string event_type = 1; + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `providers/cloud.storage/eventTypes/object.change` and
+     * `providers/cloud.pubsub/eventTypes/topic.publish`.
+     * Event types match pattern `providers/*/eventTypes/*.*`.
+     * The pattern contains:
+     * 1. namespace: For example, `cloud.storage` and
+     *    `google.firebase.analytics`.
+     * 2. resource type: The type of resource on which event occurs. For
+     *    example, the Google Cloud Storage API includes the type `object`.
+     * 3. action: The action that generates the event. For example, action for
+     *    a Google Cloud Storage Object is 'change'.
+     * These parts are lower case.
+     * 
+ * + * string event_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `providers/cloud.storage/eventTypes/object.change` and
+     * `providers/cloud.pubsub/eventTypes/topic.publish`.
+     * Event types match pattern `providers/*/eventTypes/*.*`.
+     * The pattern contains:
+     * 1. namespace: For example, `cloud.storage` and
+     *    `google.firebase.analytics`.
+     * 2. resource type: The type of resource on which event occurs. For
+     *    example, the Google Cloud Storage API includes the type `object`.
+     * 3. action: The action that generates the event. For example, action for
+     *    a Google Cloud Storage Object is 'change'.
+     * These parts are lower case.
+     * 
+ * + * string event_type = 1; + * + * @param value The bytes for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventType_ = value; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Required. The resource(s) from which to observe events, for example,
+     * `projects/_/buckets/myBucket`.
+     * Not all syntactically correct values are accepted by all services. For
+     * example:
+     * 1. The authorization model must support it. Google Cloud Functions
+     *    only allows EventTriggers to be deployed that observe resources in the
+     *    same project as the `CloudFunction`.
+     * 2. The resource type must match the pattern expected for an
+     *    `event_type`. For example, an `EventTrigger` that has an
+     *    `event_type` of "google.pubsub.topic.publish" should have a resource
+     *    that matches Google Cloud Pub/Sub topics.
+     * Additionally, some services may support short names when creating an
+     * `EventTrigger`. These will always be returned in the normalized "long"
+     * format.
+     * See each *service's* documentation for supported formats.
+     * 
+ * + * string resource = 2; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource(s) from which to observe events, for example,
+     * `projects/_/buckets/myBucket`.
+     * Not all syntactically correct values are accepted by all services. For
+     * example:
+     * 1. The authorization model must support it. Google Cloud Functions
+     *    only allows EventTriggers to be deployed that observe resources in the
+     *    same project as the `CloudFunction`.
+     * 2. The resource type must match the pattern expected for an
+     *    `event_type`. For example, an `EventTrigger` that has an
+     *    `event_type` of "google.pubsub.topic.publish" should have a resource
+     *    that matches Google Cloud Pub/Sub topics.
+     * Additionally, some services may support short names when creating an
+     * `EventTrigger`. These will always be returned in the normalized "long"
+     * format.
+     * See each *service's* documentation for supported formats.
+     * 
+ * + * string resource = 2; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource(s) from which to observe events, for example,
+     * `projects/_/buckets/myBucket`.
+     * Not all syntactically correct values are accepted by all services. For
+     * example:
+     * 1. The authorization model must support it. Google Cloud Functions
+     *    only allows EventTriggers to be deployed that observe resources in the
+     *    same project as the `CloudFunction`.
+     * 2. The resource type must match the pattern expected for an
+     *    `event_type`. For example, an `EventTrigger` that has an
+     *    `event_type` of "google.pubsub.topic.publish" should have a resource
+     *    that matches Google Cloud Pub/Sub topics.
+     * Additionally, some services may support short names when creating an
+     * `EventTrigger`. These will always be returned in the normalized "long"
+     * format.
+     * See each *service's* documentation for supported formats.
+     * 
+ * + * string resource = 2; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource(s) from which to observe events, for example,
+     * `projects/_/buckets/myBucket`.
+     * Not all syntactically correct values are accepted by all services. For
+     * example:
+     * 1. The authorization model must support it. Google Cloud Functions
+     *    only allows EventTriggers to be deployed that observe resources in the
+     *    same project as the `CloudFunction`.
+     * 2. The resource type must match the pattern expected for an
+     *    `event_type`. For example, an `EventTrigger` that has an
+     *    `event_type` of "google.pubsub.topic.publish" should have a resource
+     *    that matches Google Cloud Pub/Sub topics.
+     * Additionally, some services may support short names when creating an
+     * `EventTrigger`. These will always be returned in the normalized "long"
+     * format.
+     * See each *service's* documentation for supported formats.
+     * 
+ * + * string resource = 2; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource(s) from which to observe events, for example,
+     * `projects/_/buckets/myBucket`.
+     * Not all syntactically correct values are accepted by all services. For
+     * example:
+     * 1. The authorization model must support it. Google Cloud Functions
+     *    only allows EventTriggers to be deployed that observe resources in the
+     *    same project as the `CloudFunction`.
+     * 2. The resource type must match the pattern expected for an
+     *    `event_type`. For example, an `EventTrigger` that has an
+     *    `event_type` of "google.pubsub.topic.publish" should have a resource
+     *    that matches Google Cloud Pub/Sub topics.
+     * Additionally, some services may support short names when creating an
+     * `EventTrigger`. These will always be returned in the normalized "long"
+     * format.
+     * See each *service's* documentation for supported formats.
+     * 
+ * + * string resource = 2; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * The hostname of the service that should be observed.
+     * If no string is provided, the default service implementing the API will
+     * be used. For example, `storage.googleapis.com` is the default for all
+     * event types in the `google.storage` namespace.
+     * 
+ * + * string service = 3; + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The hostname of the service that should be observed.
+     * If no string is provided, the default service implementing the API will
+     * be used. For example, `storage.googleapis.com` is the default for all
+     * event types in the `google.storage` namespace.
+     * 
+ * + * string service = 3; + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The hostname of the service that should be observed.
+     * If no string is provided, the default service implementing the API will
+     * be used. For example, `storage.googleapis.com` is the default for all
+     * event types in the `google.storage` namespace.
+     * 
+ * + * string service = 3; + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + service_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The hostname of the service that should be observed.
+     * If no string is provided, the default service implementing the API will
+     * be used. For example, `storage.googleapis.com` is the default for all
+     * event types in the `google.storage` namespace.
+     * 
+ * + * string service = 3; + * + * @return This builder for chaining. + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + * + * + *
+     * The hostname of the service that should be observed.
+     * If no string is provided, the default service implementing the API will
+     * be used. For example, `storage.googleapis.com` is the default for all
+     * event types in the `google.storage` namespace.
+     * 
+ * + * string service = 3; + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + service_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v1.FailurePolicy failurePolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.FailurePolicy, + com.google.cloud.functions.v1.FailurePolicy.Builder, + com.google.cloud.functions.v1.FailurePolicyOrBuilder> + failurePolicyBuilder_; + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + * + * @return Whether the failurePolicy field is set. + */ + public boolean hasFailurePolicy() { + return failurePolicyBuilder_ != null || failurePolicy_ != null; + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + * + * @return The failurePolicy. + */ + public com.google.cloud.functions.v1.FailurePolicy getFailurePolicy() { + if (failurePolicyBuilder_ == null) { + return failurePolicy_ == null + ? com.google.cloud.functions.v1.FailurePolicy.getDefaultInstance() + : failurePolicy_; + } else { + return failurePolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + public Builder setFailurePolicy(com.google.cloud.functions.v1.FailurePolicy value) { + if (failurePolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + failurePolicy_ = value; + onChanged(); + } else { + failurePolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + public Builder setFailurePolicy( + com.google.cloud.functions.v1.FailurePolicy.Builder builderForValue) { + if (failurePolicyBuilder_ == null) { + failurePolicy_ = builderForValue.build(); + onChanged(); + } else { + failurePolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + public Builder mergeFailurePolicy(com.google.cloud.functions.v1.FailurePolicy value) { + if (failurePolicyBuilder_ == null) { + if (failurePolicy_ != null) { + failurePolicy_ = + com.google.cloud.functions.v1.FailurePolicy.newBuilder(failurePolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + failurePolicy_ = value; + } + onChanged(); + } else { + failurePolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + public Builder clearFailurePolicy() { + if (failurePolicyBuilder_ == null) { + failurePolicy_ = null; + onChanged(); + } else { + failurePolicy_ = null; + failurePolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + public com.google.cloud.functions.v1.FailurePolicy.Builder getFailurePolicyBuilder() { + + onChanged(); + return getFailurePolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + public com.google.cloud.functions.v1.FailurePolicyOrBuilder getFailurePolicyOrBuilder() { + if (failurePolicyBuilder_ != null) { + return failurePolicyBuilder_.getMessageOrBuilder(); + } else { + return failurePolicy_ == null + ? com.google.cloud.functions.v1.FailurePolicy.getDefaultInstance() + : failurePolicy_; + } + } + /** + * + * + *
+     * Specifies policy for failed executions.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.FailurePolicy, + com.google.cloud.functions.v1.FailurePolicy.Builder, + com.google.cloud.functions.v1.FailurePolicyOrBuilder> + getFailurePolicyFieldBuilder() { + if (failurePolicyBuilder_ == null) { + failurePolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.FailurePolicy, + com.google.cloud.functions.v1.FailurePolicy.Builder, + com.google.cloud.functions.v1.FailurePolicyOrBuilder>( + getFailurePolicy(), getParentForChildren(), isClean()); + failurePolicy_ = null; + } + return failurePolicyBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.EventTrigger) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.EventTrigger) + private static final com.google.cloud.functions.v1.EventTrigger DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.EventTrigger(); + } + + public static com.google.cloud.functions.v1.EventTrigger getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventTrigger parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventTrigger(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.EventTrigger getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/EventTriggerOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/EventTriggerOrBuilder.java new file mode 100644 index 00000000..48b6347b --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/EventTriggerOrBuilder.java @@ -0,0 +1,191 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface EventTriggerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.EventTrigger) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `providers/cloud.storage/eventTypes/object.change` and
+   * `providers/cloud.pubsub/eventTypes/topic.publish`.
+   * Event types match pattern `providers/*/eventTypes/*.*`.
+   * The pattern contains:
+   * 1. namespace: For example, `cloud.storage` and
+   *    `google.firebase.analytics`.
+   * 2. resource type: The type of resource on which event occurs. For
+   *    example, the Google Cloud Storage API includes the type `object`.
+   * 3. action: The action that generates the event. For example, action for
+   *    a Google Cloud Storage Object is 'change'.
+   * These parts are lower case.
+   * 
+ * + * string event_type = 1; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `providers/cloud.storage/eventTypes/object.change` and
+   * `providers/cloud.pubsub/eventTypes/topic.publish`.
+   * Event types match pattern `providers/*/eventTypes/*.*`.
+   * The pattern contains:
+   * 1. namespace: For example, `cloud.storage` and
+   *    `google.firebase.analytics`.
+   * 2. resource type: The type of resource on which event occurs. For
+   *    example, the Google Cloud Storage API includes the type `object`.
+   * 3. action: The action that generates the event. For example, action for
+   *    a Google Cloud Storage Object is 'change'.
+   * These parts are lower case.
+   * 
+ * + * string event_type = 1; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Required. The resource(s) from which to observe events, for example,
+   * `projects/_/buckets/myBucket`.
+   * Not all syntactically correct values are accepted by all services. For
+   * example:
+   * 1. The authorization model must support it. Google Cloud Functions
+   *    only allows EventTriggers to be deployed that observe resources in the
+   *    same project as the `CloudFunction`.
+   * 2. The resource type must match the pattern expected for an
+   *    `event_type`. For example, an `EventTrigger` that has an
+   *    `event_type` of "google.pubsub.topic.publish" should have a resource
+   *    that matches Google Cloud Pub/Sub topics.
+   * Additionally, some services may support short names when creating an
+   * `EventTrigger`. These will always be returned in the normalized "long"
+   * format.
+   * See each *service's* documentation for supported formats.
+   * 
+ * + * string resource = 2; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Required. The resource(s) from which to observe events, for example,
+   * `projects/_/buckets/myBucket`.
+   * Not all syntactically correct values are accepted by all services. For
+   * example:
+   * 1. The authorization model must support it. Google Cloud Functions
+   *    only allows EventTriggers to be deployed that observe resources in the
+   *    same project as the `CloudFunction`.
+   * 2. The resource type must match the pattern expected for an
+   *    `event_type`. For example, an `EventTrigger` that has an
+   *    `event_type` of "google.pubsub.topic.publish" should have a resource
+   *    that matches Google Cloud Pub/Sub topics.
+   * Additionally, some services may support short names when creating an
+   * `EventTrigger`. These will always be returned in the normalized "long"
+   * format.
+   * See each *service's* documentation for supported formats.
+   * 
+ * + * string resource = 2; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * The hostname of the service that should be observed.
+   * If no string is provided, the default service implementing the API will
+   * be used. For example, `storage.googleapis.com` is the default for all
+   * event types in the `google.storage` namespace.
+   * 
+ * + * string service = 3; + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * The hostname of the service that should be observed.
+   * If no string is provided, the default service implementing the API will
+   * be used. For example, `storage.googleapis.com` is the default for all
+   * event types in the `google.storage` namespace.
+   * 
+ * + * string service = 3; + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * Specifies policy for failed executions.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + * + * @return Whether the failurePolicy field is set. + */ + boolean hasFailurePolicy(); + /** + * + * + *
+   * Specifies policy for failed executions.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + * + * @return The failurePolicy. + */ + com.google.cloud.functions.v1.FailurePolicy getFailurePolicy(); + /** + * + * + *
+   * Specifies policy for failed executions.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy failure_policy = 5; + */ + com.google.cloud.functions.v1.FailurePolicyOrBuilder getFailurePolicyOrBuilder(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FailurePolicy.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FailurePolicy.java new file mode 100644 index 00000000..6a775461 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FailurePolicy.java @@ -0,0 +1,1291 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Describes the policy in case of function's execution failure.
+ * If empty, then defaults to ignoring failures (i.e. not retrying them).
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.FailurePolicy} + */ +public final class FailurePolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.FailurePolicy) + FailurePolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use FailurePolicy.newBuilder() to construct. + private FailurePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailurePolicy() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailurePolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FailurePolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder subBuilder = null; + if (actionCase_ == 1) { + subBuilder = + ((com.google.cloud.functions.v1.FailurePolicy.Retry) action_).toBuilder(); + } + action_ = + input.readMessage( + com.google.cloud.functions.v1.FailurePolicy.Retry.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v1.FailurePolicy.Retry) action_); + action_ = subBuilder.buildPartial(); + } + actionCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.FailurePolicy.class, + com.google.cloud.functions.v1.FailurePolicy.Builder.class); + } + + public interface RetryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.FailurePolicy.Retry) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Describes the retry policy in case of function's execution failure.
+   * A function execution will be retried on any failure.
+   * A failed execution will be retried up to 7 days with an exponential backoff
+   * (capped at 10 seconds).
+   * Retried execution is charged as any other execution.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.FailurePolicy.Retry} + */ + public static final class Retry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.FailurePolicy.Retry) + RetryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Retry.newBuilder() to construct. + private Retry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Retry() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Retry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Retry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_Retry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_Retry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.FailurePolicy.Retry.class, + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.FailurePolicy.Retry)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.FailurePolicy.Retry other = + (com.google.cloud.functions.v1.FailurePolicy.Retry) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.FailurePolicy.Retry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes the retry policy in case of function's execution failure.
+     * A function execution will be retried on any failure.
+     * A failed execution will be retried up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * Retried execution is charged as any other execution.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v1.FailurePolicy.Retry} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.FailurePolicy.Retry) + com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_Retry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_Retry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.FailurePolicy.Retry.class, + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.FailurePolicy.Retry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_Retry_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.Retry getDefaultInstanceForType() { + return com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.Retry build() { + com.google.cloud.functions.v1.FailurePolicy.Retry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.Retry buildPartial() { + com.google.cloud.functions.v1.FailurePolicy.Retry result = + new com.google.cloud.functions.v1.FailurePolicy.Retry(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.FailurePolicy.Retry) { + return mergeFrom((com.google.cloud.functions.v1.FailurePolicy.Retry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.FailurePolicy.Retry other) { + if (other == com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.FailurePolicy.Retry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.FailurePolicy.Retry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.FailurePolicy.Retry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.FailurePolicy.Retry) + private static final com.google.cloud.functions.v1.FailurePolicy.Retry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.FailurePolicy.Retry(); + } + + public static com.google.cloud.functions.v1.FailurePolicy.Retry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Retry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Retry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.Retry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public enum ActionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + RETRY(1), + ACTION_NOT_SET(0); + private final int value; + + private ActionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ActionCase valueOf(int value) { + return forNumber(value); + } + + public static ActionCase forNumber(int value) { + switch (value) { + case 1: + return RETRY; + case 0: + return ACTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public static final int RETRY_FIELD_NUMBER = 1; + /** + * + * + *
+   * If specified, then the function will be retried in case of a failure.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + * + * @return Whether the retry field is set. + */ + @java.lang.Override + public boolean hasRetry() { + return actionCase_ == 1; + } + /** + * + * + *
+   * If specified, then the function will be retried in case of a failure.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + * + * @return The retry. + */ + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.Retry getRetry() { + if (actionCase_ == 1) { + return (com.google.cloud.functions.v1.FailurePolicy.Retry) action_; + } + return com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } + /** + * + * + *
+   * If specified, then the function will be retried in case of a failure.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder getRetryOrBuilder() { + if (actionCase_ == 1) { + return (com.google.cloud.functions.v1.FailurePolicy.Retry) action_; + } + return com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (actionCase_ == 1) { + output.writeMessage(1, (com.google.cloud.functions.v1.FailurePolicy.Retry) action_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (actionCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.functions.v1.FailurePolicy.Retry) action_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.FailurePolicy)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.FailurePolicy other = + (com.google.cloud.functions.v1.FailurePolicy) obj; + + if (!getActionCase().equals(other.getActionCase())) return false; + switch (actionCase_) { + case 1: + if (!getRetry().equals(other.getRetry())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (actionCase_) { + case 1: + hash = (37 * hash) + RETRY_FIELD_NUMBER; + hash = (53 * hash) + getRetry().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.FailurePolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.FailurePolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the policy in case of function's execution failure.
+   * If empty, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.FailurePolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.FailurePolicy) + com.google.cloud.functions.v1.FailurePolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.FailurePolicy.class, + com.google.cloud.functions.v1.FailurePolicy.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.FailurePolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + actionCase_ = 0; + action_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_FailurePolicy_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy getDefaultInstanceForType() { + return com.google.cloud.functions.v1.FailurePolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy build() { + com.google.cloud.functions.v1.FailurePolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy buildPartial() { + com.google.cloud.functions.v1.FailurePolicy result = + new com.google.cloud.functions.v1.FailurePolicy(this); + if (actionCase_ == 1) { + if (retryBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = retryBuilder_.build(); + } + } + result.actionCase_ = actionCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.FailurePolicy) { + return mergeFrom((com.google.cloud.functions.v1.FailurePolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.FailurePolicy other) { + if (other == com.google.cloud.functions.v1.FailurePolicy.getDefaultInstance()) return this; + switch (other.getActionCase()) { + case RETRY: + { + mergeRetry(other.getRetry()); + break; + } + case ACTION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.FailurePolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v1.FailurePolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int actionCase_ = 0; + private java.lang.Object action_; + + public ActionCase getActionCase() { + return ActionCase.forNumber(actionCase_); + } + + public Builder clearAction() { + actionCase_ = 0; + action_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.FailurePolicy.Retry, + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder, + com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder> + retryBuilder_; + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + * + * @return Whether the retry field is set. + */ + @java.lang.Override + public boolean hasRetry() { + return actionCase_ == 1; + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + * + * @return The retry. + */ + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.Retry getRetry() { + if (retryBuilder_ == null) { + if (actionCase_ == 1) { + return (com.google.cloud.functions.v1.FailurePolicy.Retry) action_; + } + return com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } else { + if (actionCase_ == 1) { + return retryBuilder_.getMessage(); + } + return com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + public Builder setRetry(com.google.cloud.functions.v1.FailurePolicy.Retry value) { + if (retryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + action_ = value; + onChanged(); + } else { + retryBuilder_.setMessage(value); + } + actionCase_ = 1; + return this; + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + public Builder setRetry( + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder builderForValue) { + if (retryBuilder_ == null) { + action_ = builderForValue.build(); + onChanged(); + } else { + retryBuilder_.setMessage(builderForValue.build()); + } + actionCase_ = 1; + return this; + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + public Builder mergeRetry(com.google.cloud.functions.v1.FailurePolicy.Retry value) { + if (retryBuilder_ == null) { + if (actionCase_ == 1 + && action_ != com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance()) { + action_ = + com.google.cloud.functions.v1.FailurePolicy.Retry.newBuilder( + (com.google.cloud.functions.v1.FailurePolicy.Retry) action_) + .mergeFrom(value) + .buildPartial(); + } else { + action_ = value; + } + onChanged(); + } else { + if (actionCase_ == 1) { + retryBuilder_.mergeFrom(value); + } + retryBuilder_.setMessage(value); + } + actionCase_ = 1; + return this; + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + public Builder clearRetry() { + if (retryBuilder_ == null) { + if (actionCase_ == 1) { + actionCase_ = 0; + action_ = null; + onChanged(); + } + } else { + if (actionCase_ == 1) { + actionCase_ = 0; + action_ = null; + } + retryBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + public com.google.cloud.functions.v1.FailurePolicy.Retry.Builder getRetryBuilder() { + return getRetryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder getRetryOrBuilder() { + if ((actionCase_ == 1) && (retryBuilder_ != null)) { + return retryBuilder_.getMessageOrBuilder(); + } else { + if (actionCase_ == 1) { + return (com.google.cloud.functions.v1.FailurePolicy.Retry) action_; + } + return com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } + } + /** + * + * + *
+     * If specified, then the function will be retried in case of a failure.
+     * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.FailurePolicy.Retry, + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder, + com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder> + getRetryFieldBuilder() { + if (retryBuilder_ == null) { + if (!(actionCase_ == 1)) { + action_ = com.google.cloud.functions.v1.FailurePolicy.Retry.getDefaultInstance(); + } + retryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.FailurePolicy.Retry, + com.google.cloud.functions.v1.FailurePolicy.Retry.Builder, + com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder>( + (com.google.cloud.functions.v1.FailurePolicy.Retry) action_, + getParentForChildren(), + isClean()); + action_ = null; + } + actionCase_ = 1; + onChanged(); + ; + return retryBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.FailurePolicy) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.FailurePolicy) + private static final com.google.cloud.functions.v1.FailurePolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.FailurePolicy(); + } + + public static com.google.cloud.functions.v1.FailurePolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailurePolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FailurePolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.FailurePolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FailurePolicyOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FailurePolicyOrBuilder.java new file mode 100644 index 00000000..d5beae9d --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FailurePolicyOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface FailurePolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.FailurePolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If specified, then the function will be retried in case of a failure.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + * + * @return Whether the retry field is set. + */ + boolean hasRetry(); + /** + * + * + *
+   * If specified, then the function will be retried in case of a failure.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + * + * @return The retry. + */ + com.google.cloud.functions.v1.FailurePolicy.Retry getRetry(); + /** + * + * + *
+   * If specified, then the function will be retried in case of a failure.
+   * 
+ * + * .google.cloud.functions.v1.FailurePolicy.Retry retry = 1; + */ + com.google.cloud.functions.v1.FailurePolicy.RetryOrBuilder getRetryOrBuilder(); + + public com.google.cloud.functions.v1.FailurePolicy.ActionCase getActionCase(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java new file mode 100644 index 00000000..37d94e72 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java @@ -0,0 +1,82 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/operations.proto + +package com.google.cloud.functions.v1; + +public final class FunctionsOperationsProto { + private FunctionsOperationsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_OperationMetadataV1_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n*google/cloud/functions/v1/operations.p" + + "roto\022\031google.cloud.functions.v1\032\031google/" + + "protobuf/any.proto\032\037google/protobuf/time" + + "stamp.proto\032\034google/api/annotations.prot" + + "o\"\333\001\n\023OperationMetadataV1\022\016\n\006target\030\001 \001(" + + "\t\0226\n\004type\030\002 \001(\0162(.google.cloud.functions" + + ".v1.OperationType\022%\n\007request\030\003 \001(\0132\024.goo" + + "gle.protobuf.Any\022\022\n\nversion_id\030\004 \001(\003\022/\n\013" + + "update_time\030\005 \001(\0132\032.google.protobuf.Time" + + "stamp\022\020\n\010build_id\030\006 \001(\t*i\n\rOperationType" + + "\022\031\n\025OPERATION_UNSPECIFIED\020\000\022\023\n\017CREATE_FU" + + "NCTION\020\001\022\023\n\017UPDATE_FUNCTION\020\002\022\023\n\017DELETE_" + + "FUNCTION\020\003B\177\n\035com.google.cloud.functions" + + ".v1B\030FunctionsOperationsProtoP\001ZBgoogle." + + "golang.org/genproto/googleapis/cloud/fun" + + "ctions/v1;functionsb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.api.AnnotationsProto.getDescriptor(), + }); + internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_functions_v1_OperationMetadataV1_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor, + new java.lang.String[] { + "Target", "Type", "Request", "VersionId", "UpdateTime", "BuildId", + }); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java new file mode 100644 index 00000000..0f4f6661 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java @@ -0,0 +1,490 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public final class FunctionsProto { + private FunctionsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_CloudFunction_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_CloudFunction_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_CloudFunction_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_CloudFunction_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_CloudFunction_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_CloudFunction_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_SourceRepository_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_SourceRepository_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_HttpsTrigger_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_HttpsTrigger_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_EventTrigger_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_EventTrigger_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_FailurePolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_FailurePolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_FailurePolicy_Retry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_FailurePolicy_Retry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_CreateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_CreateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_UpdateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_UpdateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_GetFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_GetFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_ListFunctionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_ListFunctionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_ListFunctionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_ListFunctionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_DeleteFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_DeleteFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_CallFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_CallFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_CallFunctionResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_CallFunctionResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/cloud/functions/v1/functions.pr" + + "oto\022\031google.cloud.functions.v1\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\032\036google/iam/v1" + + "/iam_policy.proto\032\032google/iam/v1/policy." + + "proto\032#google/longrunning/operations.pro" + + "to\032\036google/protobuf/duration.proto\032 goog" + + "le/protobuf/field_mask.proto\032\037google/pro" + + "tobuf/timestamp.proto\"\203\014\n\rCloudFunction\022" + + "\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\022\034\n\022so" + + "urce_archive_url\030\003 \001(\tH\000\022H\n\021source_repos" + + "itory\030\004 \001(\0132+.google.cloud.functions.v1." + + "SourceRepositoryH\000\022\033\n\021source_upload_url\030" + + "\020 \001(\tH\000\022@\n\rhttps_trigger\030\005 \001(\0132\'.google." + + "cloud.functions.v1.HttpsTriggerH\001\022@\n\reve" + + "nt_trigger\030\006 \001(\0132\'.google.cloud.function" + + "s.v1.EventTriggerH\001\022C\n\006status\030\007 \001(\0162..go" + + "ogle.cloud.functions.v1.CloudFunctionSta" + + "tusB\003\340A\003\022\023\n\013entry_point\030\010 \001(\t\022\017\n\007runtime" + + "\030\023 \001(\t\022*\n\007timeout\030\t \001(\0132\031.google.protobu" + + "f.Duration\022\033\n\023available_memory_mb\030\n \001(\005\022" + + "\035\n\025service_account_email\030\013 \001(\t\0224\n\013update" + + "_time\030\014 \001(\0132\032.google.protobuf.TimestampB" + + "\003\340A\003\022\027\n\nversion_id\030\016 \001(\003B\003\340A\003\022D\n\006labels\030" + + "\017 \003(\01324.google.cloud.functions.v1.CloudF" + + "unction.LabelsEntry\022a\n\025environment_varia" + + "bles\030\021 \003(\0132B.google.cloud.functions.v1.C" + + "loudFunction.EnvironmentVariablesEntry\022\017" + + "\n\007network\030\022 \001(\t\022\025\n\rmax_instances\030\024 \001(\005\022\025" + + "\n\rvpc_connector\030\026 \001(\t\022j\n\035vpc_connector_e" + + "gress_settings\030\027 \001(\0162C.google.cloud.func" + + "tions.v1.CloudFunction.VpcConnectorEgres" + + "sSettings\022R\n\020ingress_settings\030\030 \001(\01628.go" + + "ogle.cloud.functions.v1.CloudFunction.In" + + "gressSettings\022\025\n\010build_id\030\033 \001(\tB\003\340A\003\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\032;\n\031EnvironmentVariablesEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u\n\032VpcConnector" + + "EgressSettings\022-\n)VPC_CONNECTOR_EGRESS_S" + + "ETTINGS_UNSPECIFIED\020\000\022\027\n\023PRIVATE_RANGES_" + + "ONLY\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n\017IngressSettin" + + "gs\022 \n\034INGRESS_SETTINGS_UNSPECIFIED\020\000\022\r\n\t" + + "ALLOW_ALL\020\001\022\027\n\023ALLOW_INTERNAL_ONLY\020\002\022\033\n\027" + + "ALLOW_INTERNAL_AND_GCLB\020\003:n\352Ak\n+cloudfun" + + "ctions.googleapis.com/CloudFunction\022\n\032Generate" + + "DownloadUrlRequest\022\014\n\004name\030\001 \001(\t\022\022\n\nvers" + + "ion_id\030\002 \001(\004\"3\n\033GenerateDownloadUrlRespo" + + "nse\022\024\n\014download_url\030\001 \001(\t*\222\001\n\023CloudFunct" + + "ionStatus\022%\n!CLOUD_FUNCTION_STATUS_UNSPE" + + "CIFIED\020\000\022\n\n\006ACTIVE\020\001\022\013\n\007OFFLINE\020\002\022\026\n\022DEP" + + "LOY_IN_PROGRESS\020\003\022\026\n\022DELETE_IN_PROGRESS\020" + + "\004\022\013\n\007UNKNOWN\020\0052\227\021\n\025CloudFunctionsService" + + "\022\251\001\n\rListFunctions\022/.google.cloud.functi" + + "ons.v1.ListFunctionsRequest\0320.google.clo" + + "ud.functions.v1.ListFunctionsResponse\"5\202" + + "\323\344\223\002/\022-/v1/{parent=projects/*/locations/" + + "*}/functions\022\244\001\n\013GetFunction\022-.google.cl" + + "oud.functions.v1.GetFunctionRequest\032(.go" + + "ogle.cloud.functions.v1.CloudFunction\"<\202" + + "\323\344\223\002/\022-/v1/{name=projects/*/locations/*/" + + "functions/*}\332A\004name\022\337\001\n\016CreateFunction\0220" + + ".google.cloud.functions.v1.CreateFunctio" + + "nRequest\032\035.google.longrunning.Operation\"" + + "|\202\323\344\223\002;\"//v1/{location=projects/*/locati" + + "ons/*}/functions:\010function\332A\021location,fu" + + "nction\312A$\n\rCloudFunction\022\023OperationMetad" + + "ataV1\022\335\001\n\016UpdateFunction\0220.google.cloud." + + "functions.v1.UpdateFunctionRequest\032\035.goo" + + "gle.longrunning.Operation\"z\202\323\344\223\002B26/v1/{" + + "function.name=projects/*/locations/*/fun" + + "ctions/*}:\010function\332A\010function\312A$\n\rCloud" + + "Function\022\023OperationMetadataV1\022\316\001\n\016Delete" + + "Function\0220.google.cloud.functions.v1.Del" + + "eteFunctionRequest\032\035.google.longrunning." + + "Operation\"k\202\323\344\223\002/*-/v1/{name=projects/*/" + + "locations/*/functions/*}\332A\004name\312A,\n\025goog" + + "le.protobuf.Empty\022\023OperationMetadataV1\022\272" + + "\001\n\014CallFunction\022..google.cloud.functions" + + ".v1.CallFunctionRequest\032/.google.cloud.f" + + "unctions.v1.CallFunctionResponse\"I\202\323\344\223\0027" + + "\"2/v1/{name=projects/*/locations/*/funct" + + "ions/*}:call:\001*\332A\tname,data\022\312\001\n\021Generate" + + "UploadUrl\0223.google.cloud.functions.v1.Ge" + + "nerateUploadUrlRequest\0324.google.cloud.fu" + + "nctions.v1.GenerateUploadUrlResponse\"J\202\323" + + "\344\223\002D\"?/v1/{parent=projects/*/locations/*" + + "}/functions:generateUploadUrl:\001*\022\322\001\n\023Gen" + + "erateDownloadUrl\0225.google.cloud.function" + + "s.v1.GenerateDownloadUrlRequest\0326.google" + + ".cloud.functions.v1.GenerateDownloadUrlR" + + "esponse\"L\202\323\344\223\002F\"A/v1/{name=projects/*/lo" + + "cations/*/functions/*}:generateDownloadU" + + "rl:\001*\022\224\001\n\014SetIamPolicy\022\".google.iam.v1.S" + + "etIamPolicyRequest\032\025.google.iam.v1.Polic" + + "y\"I\202\323\344\223\002C\">/v1/{resource=projects/*/loca" + + "tions/*/functions/*}:setIamPolicy:\001*\022\221\001\n" + + "\014GetIamPolicy\022\".google.iam.v1.GetIamPoli" + + "cyRequest\032\025.google.iam.v1.Policy\"F\202\323\344\223\002@" + + "\022>/v1/{resource=projects/*/locations/*/f" + + "unctions/*}:getIamPolicy\022\272\001\n\022TestIamPerm" + + "issions\022(.google.iam.v1.TestIamPermissio" + + "nsRequest\032).google.iam.v1.TestIamPermiss" + + "ionsResponse\"O\202\323\344\223\002I\"D/v1/{resource=proj" + + "ects/*/locations/*/functions/*}:testIamP" + + "ermissions:\001*\032Q\312A\035cloudfunctions.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformB{\n\035com.google.cloud.fun" + + "ctions.v1B\016FunctionsProtoP\001ZBgoogle.gola" + + "ng.org/genproto/googleapis/cloud/functio" + + "ns/v1;functions\242\002\003GCFb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_functions_v1_CloudFunction_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_functions_v1_CloudFunction_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_CloudFunction_descriptor, + new java.lang.String[] { + "Name", + "Description", + "SourceArchiveUrl", + "SourceRepository", + "SourceUploadUrl", + "HttpsTrigger", + "EventTrigger", + "Status", + "EntryPoint", + "Runtime", + "Timeout", + "AvailableMemoryMb", + "ServiceAccountEmail", + "UpdateTime", + "VersionId", + "Labels", + "EnvironmentVariables", + "Network", + "MaxInstances", + "VpcConnector", + "VpcConnectorEgressSettings", + "IngressSettings", + "BuildId", + "SourceCode", + "Trigger", + }); + internal_static_google_cloud_functions_v1_CloudFunction_LabelsEntry_descriptor = + internal_static_google_cloud_functions_v1_CloudFunction_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v1_CloudFunction_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_CloudFunction_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v1_CloudFunction_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v1_CloudFunction_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_functions_v1_CloudFunction_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_CloudFunction_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v1_SourceRepository_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_functions_v1_SourceRepository_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_SourceRepository_descriptor, + new java.lang.String[] { + "Url", "DeployedUrl", + }); + internal_static_google_cloud_functions_v1_HttpsTrigger_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_functions_v1_HttpsTrigger_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_HttpsTrigger_descriptor, + new java.lang.String[] { + "Url", + }); + internal_static_google_cloud_functions_v1_EventTrigger_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_functions_v1_EventTrigger_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_EventTrigger_descriptor, + new java.lang.String[] { + "EventType", "Resource", "Service", "FailurePolicy", + }); + internal_static_google_cloud_functions_v1_FailurePolicy_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_functions_v1_FailurePolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_FailurePolicy_descriptor, + new java.lang.String[] { + "Retry", "Action", + }); + internal_static_google_cloud_functions_v1_FailurePolicy_Retry_descriptor = + internal_static_google_cloud_functions_v1_FailurePolicy_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v1_FailurePolicy_Retry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_FailurePolicy_Retry_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_functions_v1_CreateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_functions_v1_CreateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_CreateFunctionRequest_descriptor, + new java.lang.String[] { + "Location", "Function", + }); + internal_static_google_cloud_functions_v1_UpdateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_functions_v1_UpdateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_UpdateFunctionRequest_descriptor, + new java.lang.String[] { + "Function", "UpdateMask", + }); + internal_static_google_cloud_functions_v1_GetFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_functions_v1_GetFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_GetFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v1_ListFunctionsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_functions_v1_ListFunctionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_ListFunctionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_functions_v1_ListFunctionsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_functions_v1_ListFunctionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_ListFunctionsResponse_descriptor, + new java.lang.String[] { + "Functions", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_functions_v1_DeleteFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_functions_v1_DeleteFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_DeleteFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v1_CallFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_functions_v1_CallFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_CallFunctionRequest_descriptor, + new java.lang.String[] { + "Name", "Data", + }); + internal_static_google_cloud_functions_v1_CallFunctionResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_functions_v1_CallFunctionResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_CallFunctionResponse_descriptor, + new java.lang.String[] { + "ExecutionId", "Result", "Error", + }); + internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor, + new java.lang.String[] { + "UploadUrl", + }); + internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_descriptor, + new java.lang.String[] { + "Name", "VersionId", + }); + internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_descriptor, + new java.lang.String[] { + "DownloadUrl", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlRequest.java new file mode 100644 index 00000000..1280034b --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlRequest.java @@ -0,0 +1,738 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateDownloadUrlRequest} + */ +public final class GenerateDownloadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.GenerateDownloadUrlRequest) + GenerateDownloadUrlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateDownloadUrlRequest.newBuilder() to construct. + private GenerateDownloadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateDownloadUrlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateDownloadUrlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateDownloadUrlRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + versionId_ = input.readUInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v1.GenerateDownloadUrlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_ID_FIELD_NUMBER = 2; + private long versionId_; + /** + * + * + *
+   * The optional version of function. If not set, default, current version
+   * is used.
+   * 
+ * + * uint64 version_id = 2; + * + * @return The versionId. + */ + @java.lang.Override + public long getVersionId() { + return versionId_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (versionId_ != 0L) { + output.writeUInt64(2, versionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (versionId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeUInt64Size(2, versionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.GenerateDownloadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.GenerateDownloadUrlRequest other = + (com.google.cloud.functions.v1.GenerateDownloadUrlRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getVersionId() != other.getVersionId()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersionId()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request of `GenerateDownloadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateDownloadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.GenerateDownloadUrlRequest) + com.google.cloud.functions.v1.GenerateDownloadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v1.GenerateDownloadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.GenerateDownloadUrlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + versionId_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.GenerateDownloadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlRequest build() { + com.google.cloud.functions.v1.GenerateDownloadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlRequest buildPartial() { + com.google.cloud.functions.v1.GenerateDownloadUrlRequest result = + new com.google.cloud.functions.v1.GenerateDownloadUrlRequest(this); + result.name_ = name_; + result.versionId_ = versionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.GenerateDownloadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v1.GenerateDownloadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.GenerateDownloadUrlRequest other) { + if (other == com.google.cloud.functions.v1.GenerateDownloadUrlRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getVersionId() != 0L) { + setVersionId(other.getVersionId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.GenerateDownloadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.GenerateDownloadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private long versionId_; + /** + * + * + *
+     * The optional version of function. If not set, default, current version
+     * is used.
+     * 
+ * + * uint64 version_id = 2; + * + * @return The versionId. + */ + @java.lang.Override + public long getVersionId() { + return versionId_; + } + /** + * + * + *
+     * The optional version of function. If not set, default, current version
+     * is used.
+     * 
+ * + * uint64 version_id = 2; + * + * @param value The versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionId(long value) { + + versionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The optional version of function. If not set, default, current version
+     * is used.
+     * 
+ * + * uint64 version_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersionId() { + + versionId_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.GenerateDownloadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.GenerateDownloadUrlRequest) + private static final com.google.cloud.functions.v1.GenerateDownloadUrlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.GenerateDownloadUrlRequest(); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateDownloadUrlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateDownloadUrlRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlRequestOrBuilder.java new file mode 100644 index 00000000..280969eb --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface GenerateDownloadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.GenerateDownloadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The optional version of function. If not set, default, current version
+   * is used.
+   * 
+ * + * uint64 version_id = 2; + * + * @return The versionId. + */ + long getVersionId(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlResponse.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlResponse.java new file mode 100644 index 00000000..a55bdc7d --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlResponse.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Response of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateDownloadUrlResponse} + */ +public final class GenerateDownloadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.GenerateDownloadUrlResponse) + GenerateDownloadUrlResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateDownloadUrlResponse.newBuilder() to construct. + private GenerateDownloadUrlResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateDownloadUrlResponse() { + downloadUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateDownloadUrlResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateDownloadUrlResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + downloadUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v1.GenerateDownloadUrlResponse.Builder.class); + } + + public static final int DOWNLOAD_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object downloadUrl_; + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + @java.lang.Override + public java.lang.String getDownloadUrl() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + downloadUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDownloadUrlBytes() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + downloadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getDownloadUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, downloadUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDownloadUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, downloadUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.GenerateDownloadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.GenerateDownloadUrlResponse other = + (com.google.cloud.functions.v1.GenerateDownloadUrlResponse) obj; + + if (!getDownloadUrl().equals(other.getDownloadUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOWNLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getDownloadUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v1.GenerateDownloadUrlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `GenerateDownloadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateDownloadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.GenerateDownloadUrlResponse) + com.google.cloud.functions.v1.GenerateDownloadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v1.GenerateDownloadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.GenerateDownloadUrlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + downloadUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v1.GenerateDownloadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlResponse build() { + com.google.cloud.functions.v1.GenerateDownloadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlResponse buildPartial() { + com.google.cloud.functions.v1.GenerateDownloadUrlResponse result = + new com.google.cloud.functions.v1.GenerateDownloadUrlResponse(this); + result.downloadUrl_ = downloadUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.GenerateDownloadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v1.GenerateDownloadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.GenerateDownloadUrlResponse other) { + if (other == com.google.cloud.functions.v1.GenerateDownloadUrlResponse.getDefaultInstance()) + return this; + if (!other.getDownloadUrl().isEmpty()) { + downloadUrl_ = other.downloadUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.GenerateDownloadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.GenerateDownloadUrlResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object downloadUrl_ = ""; + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + public java.lang.String getDownloadUrl() { + java.lang.Object ref = downloadUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + downloadUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + public com.google.protobuf.ByteString getDownloadUrlBytes() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + downloadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @param value The downloadUrl to set. + * @return This builder for chaining. + */ + public Builder setDownloadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + downloadUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearDownloadUrl() { + + downloadUrl_ = getDefaultInstance().getDownloadUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @param value The bytes for downloadUrl to set. + * @return This builder for chaining. + */ + public Builder setDownloadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + downloadUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.GenerateDownloadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.GenerateDownloadUrlResponse) + private static final com.google.cloud.functions.v1.GenerateDownloadUrlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.GenerateDownloadUrlResponse(); + } + + public static com.google.cloud.functions.v1.GenerateDownloadUrlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateDownloadUrlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateDownloadUrlResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateDownloadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlResponseOrBuilder.java new file mode 100644 index 00000000..3adfa02f --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateDownloadUrlResponseOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface GenerateDownloadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.GenerateDownloadUrlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + java.lang.String getDownloadUrl(); + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + com.google.protobuf.ByteString getDownloadUrlBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java new file mode 100644 index 00000000..4910b85b --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateUploadUrlRequest} + */ +public final class GenerateUploadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.GenerateUploadUrlRequest) + GenerateUploadUrlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateUploadUrlRequest.newBuilder() to construct. + private GenerateUploadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateUploadUrlRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateUploadUrlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateUploadUrlRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v1.GenerateUploadUrlRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.GenerateUploadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.GenerateUploadUrlRequest other = + (com.google.cloud.functions.v1.GenerateUploadUrlRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v1.GenerateUploadUrlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request of `GenerateSourceUploadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateUploadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.GenerateUploadUrlRequest) + com.google.cloud.functions.v1.GenerateUploadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v1.GenerateUploadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.GenerateUploadUrlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.GenerateUploadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlRequest build() { + com.google.cloud.functions.v1.GenerateUploadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlRequest buildPartial() { + com.google.cloud.functions.v1.GenerateUploadUrlRequest result = + new com.google.cloud.functions.v1.GenerateUploadUrlRequest(this); + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.GenerateUploadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v1.GenerateUploadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.GenerateUploadUrlRequest other) { + if (other == com.google.cloud.functions.v1.GenerateUploadUrlRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.GenerateUploadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.GenerateUploadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.GenerateUploadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.GenerateUploadUrlRequest) + private static final com.google.cloud.functions.v1.GenerateUploadUrlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.GenerateUploadUrlRequest(); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateUploadUrlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateUploadUrlRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java new file mode 100644 index 00000000..8aaade6f --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface GenerateUploadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.GenerateUploadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlResponse.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlResponse.java new file mode 100644 index 00000000..55844172 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlResponse.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Response of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateUploadUrlResponse} + */ +public final class GenerateUploadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.GenerateUploadUrlResponse) + GenerateUploadUrlResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateUploadUrlResponse.newBuilder() to construct. + private GenerateUploadUrlResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateUploadUrlResponse() { + uploadUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateUploadUrlResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateUploadUrlResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uploadUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v1.GenerateUploadUrlResponse.Builder.class); + } + + public static final int UPLOAD_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object uploadUrl_; + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + @java.lang.Override + public java.lang.String getUploadUrl() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUploadUrlBytes() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUploadUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUploadUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.GenerateUploadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.GenerateUploadUrlResponse other = + (com.google.cloud.functions.v1.GenerateUploadUrlResponse) obj; + + if (!getUploadUrl().equals(other.getUploadUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UPLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getUploadUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v1.GenerateUploadUrlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `GenerateSourceUploadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GenerateUploadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.GenerateUploadUrlResponse) + com.google.cloud.functions.v1.GenerateUploadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v1.GenerateUploadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.GenerateUploadUrlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uploadUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v1.GenerateUploadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlResponse build() { + com.google.cloud.functions.v1.GenerateUploadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlResponse buildPartial() { + com.google.cloud.functions.v1.GenerateUploadUrlResponse result = + new com.google.cloud.functions.v1.GenerateUploadUrlResponse(this); + result.uploadUrl_ = uploadUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.GenerateUploadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v1.GenerateUploadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.GenerateUploadUrlResponse other) { + if (other == com.google.cloud.functions.v1.GenerateUploadUrlResponse.getDefaultInstance()) + return this; + if (!other.getUploadUrl().isEmpty()) { + uploadUrl_ = other.uploadUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.GenerateUploadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.GenerateUploadUrlResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uploadUrl_ = ""; + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + public java.lang.String getUploadUrl() { + java.lang.Object ref = uploadUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + public com.google.protobuf.ByteString getUploadUrlBytes() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @param value The uploadUrl to set. + * @return This builder for chaining. + */ + public Builder setUploadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uploadUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearUploadUrl() { + + uploadUrl_ = getDefaultInstance().getUploadUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @param value The bytes for uploadUrl to set. + * @return This builder for chaining. + */ + public Builder setUploadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uploadUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.GenerateUploadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.GenerateUploadUrlResponse) + private static final com.google.cloud.functions.v1.GenerateUploadUrlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.GenerateUploadUrlResponse(); + } + + public static com.google.cloud.functions.v1.GenerateUploadUrlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateUploadUrlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateUploadUrlResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GenerateUploadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlResponseOrBuilder.java new file mode 100644 index 00000000..221db44e --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlResponseOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface GenerateUploadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.GenerateUploadUrlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + java.lang.String getUploadUrl(); + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + com.google.protobuf.ByteString getUploadUrlBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GetFunctionRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GetFunctionRequest.java new file mode 100644 index 00000000..1257655b --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GetFunctionRequest.java @@ -0,0 +1,649 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request for the `GetFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GetFunctionRequest} + */ +public final class GetFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.GetFunctionRequest) + GetFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFunctionRequest.newBuilder() to construct. + private GetFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFunctionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GetFunctionRequest.class, + com.google.cloud.functions.v1.GetFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.GetFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.GetFunctionRequest other = + (com.google.cloud.functions.v1.GetFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.GetFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `GetFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.GetFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.GetFunctionRequest) + com.google.cloud.functions.v1.GetFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.GetFunctionRequest.class, + com.google.cloud.functions.v1.GetFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.GetFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_GetFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GetFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.GetFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.GetFunctionRequest build() { + com.google.cloud.functions.v1.GetFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GetFunctionRequest buildPartial() { + com.google.cloud.functions.v1.GetFunctionRequest result = + new com.google.cloud.functions.v1.GetFunctionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.GetFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v1.GetFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.GetFunctionRequest other) { + if (other == com.google.cloud.functions.v1.GetFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.GetFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v1.GetFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.GetFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.GetFunctionRequest) + private static final com.google.cloud.functions.v1.GetFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.GetFunctionRequest(); + } + + public static com.google.cloud.functions.v1.GetFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.GetFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GetFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GetFunctionRequestOrBuilder.java new file mode 100644 index 00000000..8993bd6e --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GetFunctionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface GetFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.GetFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/HttpsTrigger.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/HttpsTrigger.java new file mode 100644 index 00000000..f269fa3c --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/HttpsTrigger.java @@ -0,0 +1,634 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Describes HttpsTrigger, could be used to connect web hooks to function.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.HttpsTrigger} + */ +public final class HttpsTrigger extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.HttpsTrigger) + HttpsTriggerOrBuilder { + private static final long serialVersionUID = 0L; + // Use HttpsTrigger.newBuilder() to construct. + private HttpsTrigger(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HttpsTrigger() { + url_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HttpsTrigger(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private HttpsTrigger( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_HttpsTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_HttpsTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.HttpsTrigger.class, + com.google.cloud.functions.v1.HttpsTrigger.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.HttpsTrigger)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.HttpsTrigger other = + (com.google.cloud.functions.v1.HttpsTrigger) obj; + + if (!getUrl().equals(other.getUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.HttpsTrigger parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.HttpsTrigger prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes HttpsTrigger, could be used to connect web hooks to function.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.HttpsTrigger} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.HttpsTrigger) + com.google.cloud.functions.v1.HttpsTriggerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_HttpsTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_HttpsTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.HttpsTrigger.class, + com.google.cloud.functions.v1.HttpsTrigger.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.HttpsTrigger.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + url_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_HttpsTrigger_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTrigger getDefaultInstanceForType() { + return com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTrigger build() { + com.google.cloud.functions.v1.HttpsTrigger result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTrigger buildPartial() { + com.google.cloud.functions.v1.HttpsTrigger result = + new com.google.cloud.functions.v1.HttpsTrigger(this); + result.url_ = url_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.HttpsTrigger) { + return mergeFrom((com.google.cloud.functions.v1.HttpsTrigger) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.HttpsTrigger other) { + if (other == com.google.cloud.functions.v1.HttpsTrigger.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.HttpsTrigger parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v1.HttpsTrigger) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for url. + */ + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.HttpsTrigger) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.HttpsTrigger) + private static final com.google.cloud.functions.v1.HttpsTrigger DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.HttpsTrigger(); + } + + public static com.google.cloud.functions.v1.HttpsTrigger getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpsTrigger parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpsTrigger(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.HttpsTrigger getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/HttpsTriggerOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/HttpsTriggerOrBuilder.java new file mode 100644 index 00000000..4c15fb07 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/HttpsTriggerOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface HttpsTriggerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.HttpsTrigger) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The url. + */ + java.lang.String getUrl(); + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for url. + */ + com.google.protobuf.ByteString getUrlBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsRequest.java new file mode 100644 index 00000000..841fa0c7 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsRequest.java @@ -0,0 +1,961 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.ListFunctionsRequest} + */ +public final class ListFunctionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.ListFunctionsRequest) + ListFunctionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFunctionsRequest.newBuilder() to construct. + private ListFunctionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFunctionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFunctionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFunctionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.ListFunctionsRequest.class, + com.google.cloud.functions.v1.ListFunctionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of functions to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.ListFunctionsRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.ListFunctionsRequest other = + (com.google.cloud.functions.v1.ListFunctionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.ListFunctionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListFunctions` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.ListFunctionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.ListFunctionsRequest) + com.google.cloud.functions.v1.ListFunctionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.ListFunctionsRequest.class, + com.google.cloud.functions.v1.ListFunctionsRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.ListFunctionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.ListFunctionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsRequest build() { + com.google.cloud.functions.v1.ListFunctionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsRequest buildPartial() { + com.google.cloud.functions.v1.ListFunctionsRequest result = + new com.google.cloud.functions.v1.ListFunctionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.ListFunctionsRequest) { + return mergeFrom((com.google.cloud.functions.v1.ListFunctionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.ListFunctionsRequest other) { + if (other == com.google.cloud.functions.v1.ListFunctionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.ListFunctionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.ListFunctionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.ListFunctionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.ListFunctionsRequest) + private static final com.google.cloud.functions.v1.ListFunctionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.ListFunctionsRequest(); + } + + public static com.google.cloud.functions.v1.ListFunctionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFunctionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFunctionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsRequestOrBuilder.java new file mode 100644 index 00000000..b1f834f8 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface ListFunctionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.ListFunctionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * string parent = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of functions to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsResponse.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsResponse.java new file mode 100644 index 00000000..cc730cf8 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsResponse.java @@ -0,0 +1,1440 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Response for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.ListFunctionsResponse} + */ +public final class ListFunctionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.ListFunctionsResponse) + ListFunctionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFunctionsResponse.newBuilder() to construct. + private ListFunctionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFunctionsResponse() { + functions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFunctionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFunctionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + functions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + functions_.add( + input.readMessage( + com.google.cloud.functions.v1.CloudFunction.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + functions_ = java.util.Collections.unmodifiableList(functions_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.ListFunctionsResponse.class, + com.google.cloud.functions.v1.ListFunctionsResponse.Builder.class); + } + + public static final int FUNCTIONS_FIELD_NUMBER = 1; + private java.util.List functions_; + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + @java.lang.Override + public java.util.List getFunctionsList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + @java.lang.Override + public java.util.List + getFunctionsOrBuilderList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + @java.lang.Override + public int getFunctionsCount() { + return functions_.size(); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction getFunctions(int index) { + return functions_.get(index); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionsOrBuilder(int index) { + return functions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * If not empty, indicates that there may be more functions that match
+   * the request; this value should be passed in a new
+   * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+   * to get more functions.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * If not empty, indicates that there may be more functions that match
+   * the request; this value should be passed in a new
+   * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+   * to get more functions.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < functions_.size(); i++) { + output.writeMessage(1, functions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < functions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, functions_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.ListFunctionsResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.ListFunctionsResponse other = + (com.google.cloud.functions.v1.ListFunctionsResponse) obj; + + if (!getFunctionsList().equals(other.getFunctionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFunctionsCount() > 0) { + hash = (37 * hash) + FUNCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFunctionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.ListFunctionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListFunctions` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.ListFunctionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.ListFunctionsResponse) + com.google.cloud.functions.v1.ListFunctionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.ListFunctionsResponse.class, + com.google.cloud.functions.v1.ListFunctionsResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.ListFunctionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFunctionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (functionsBuilder_ == null) { + functions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + functionsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v1.ListFunctionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsResponse build() { + com.google.cloud.functions.v1.ListFunctionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsResponse buildPartial() { + com.google.cloud.functions.v1.ListFunctionsResponse result = + new com.google.cloud.functions.v1.ListFunctionsResponse(this); + int from_bitField0_ = bitField0_; + if (functionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + functions_ = java.util.Collections.unmodifiableList(functions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.functions_ = functions_; + } else { + result.functions_ = functionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.ListFunctionsResponse) { + return mergeFrom((com.google.cloud.functions.v1.ListFunctionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.ListFunctionsResponse other) { + if (other == com.google.cloud.functions.v1.ListFunctionsResponse.getDefaultInstance()) + return this; + if (functionsBuilder_ == null) { + if (!other.functions_.isEmpty()) { + if (functions_.isEmpty()) { + functions_ = other.functions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFunctionsIsMutable(); + functions_.addAll(other.functions_); + } + onChanged(); + } + } else { + if (!other.functions_.isEmpty()) { + if (functionsBuilder_.isEmpty()) { + functionsBuilder_.dispose(); + functionsBuilder_ = null; + functions_ = other.functions_; + bitField0_ = (bitField0_ & ~0x00000001); + functionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFunctionsFieldBuilder() + : null; + } else { + functionsBuilder_.addAllMessages(other.functions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.ListFunctionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.ListFunctionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List functions_ = + java.util.Collections.emptyList(); + + private void ensureFunctionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + functions_ = + new java.util.ArrayList(functions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder> + functionsBuilder_; + + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public java.util.List getFunctionsList() { + if (functionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(functions_); + } else { + return functionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public int getFunctionsCount() { + if (functionsBuilder_ == null) { + return functions_.size(); + } else { + return functionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public com.google.cloud.functions.v1.CloudFunction getFunctions(int index) { + if (functionsBuilder_ == null) { + return functions_.get(index); + } else { + return functionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder setFunctions(int index, com.google.cloud.functions.v1.CloudFunction value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.set(index, value); + onChanged(); + } else { + functionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder setFunctions( + int index, com.google.cloud.functions.v1.CloudFunction.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.set(index, builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder addFunctions(com.google.cloud.functions.v1.CloudFunction value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.add(value); + onChanged(); + } else { + functionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder addFunctions(int index, com.google.cloud.functions.v1.CloudFunction value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.add(index, value); + onChanged(); + } else { + functionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder addFunctions( + com.google.cloud.functions.v1.CloudFunction.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.add(builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder addFunctions( + int index, com.google.cloud.functions.v1.CloudFunction.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.add(index, builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder addAllFunctions( + java.lang.Iterable values) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, functions_); + onChanged(); + } else { + functionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder clearFunctions() { + if (functionsBuilder_ == null) { + functions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + functionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public Builder removeFunctions(int index) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.remove(index); + onChanged(); + } else { + functionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public com.google.cloud.functions.v1.CloudFunction.Builder getFunctionsBuilder(int index) { + return getFunctionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionsOrBuilder(int index) { + if (functionsBuilder_ == null) { + return functions_.get(index); + } else { + return functionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public java.util.List + getFunctionsOrBuilderList() { + if (functionsBuilder_ != null) { + return functionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(functions_); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public com.google.cloud.functions.v1.CloudFunction.Builder addFunctionsBuilder() { + return getFunctionsFieldBuilder() + .addBuilder(com.google.cloud.functions.v1.CloudFunction.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public com.google.cloud.functions.v1.CloudFunction.Builder addFunctionsBuilder(int index) { + return getFunctionsFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v1.CloudFunction.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + public java.util.List + getFunctionsBuilderList() { + return getFunctionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder> + getFunctionsFieldBuilder() { + if (functionsBuilder_ == null) { + functionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder>( + functions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + functions_ = null; + } + return functionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * If not empty, indicates that there may be more functions that match
+     * the request; this value should be passed in a new
+     * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+     * to get more functions.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * If not empty, indicates that there may be more functions that match
+     * the request; this value should be passed in a new
+     * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+     * to get more functions.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * If not empty, indicates that there may be more functions that match
+     * the request; this value should be passed in a new
+     * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+     * to get more functions.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If not empty, indicates that there may be more functions that match
+     * the request; this value should be passed in a new
+     * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+     * to get more functions.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * If not empty, indicates that there may be more functions that match
+     * the request; this value should be passed in a new
+     * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+     * to get more functions.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.ListFunctionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.ListFunctionsResponse) + private static final com.google.cloud.functions.v1.ListFunctionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.ListFunctionsResponse(); + } + + public static com.google.cloud.functions.v1.ListFunctionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFunctionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFunctionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.ListFunctionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsResponseOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsResponseOrBuilder.java new file mode 100644 index 00000000..1557cf8c --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/ListFunctionsResponseOrBuilder.java @@ -0,0 +1,163 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface ListFunctionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.ListFunctionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + java.util.List getFunctionsList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + com.google.cloud.functions.v1.CloudFunction getFunctions(int index); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + int getFunctionsCount(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + java.util.List + getFunctionsOrBuilderList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v1.CloudFunction functions = 1; + */ + com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionsOrBuilder(int index); + + /** + * + * + *
+   * If not empty, indicates that there may be more functions that match
+   * the request; this value should be passed in a new
+   * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+   * to get more functions.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * If not empty, indicates that there may be more functions that match
+   * the request; this value should be passed in a new
+   * [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest]
+   * to get more functions.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/LocationName.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/LocationName.java new file mode 100644 index 00000000..17858662 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/LocationName.java @@ -0,0 +1,182 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() {} + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationMetadataV1.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationMetadataV1.java new file mode 100644 index 00000000..ae7eb1fb --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationMetadataV1.java @@ -0,0 +1,1610 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/operations.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Metadata describing an [Operation][google.longrunning.Operation]
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.OperationMetadataV1} + */ +public final class OperationMetadataV1 extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.OperationMetadataV1) + OperationMetadataV1OrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadataV1.newBuilder() to construct. + private OperationMetadataV1(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadataV1() { + target_ = ""; + type_ = 0; + buildId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadataV1(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadataV1( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 26: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 32: + { + versionId_ = input.readInt64(); + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + buildId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsOperationsProto + .internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsOperationsProto + .internal_static_google_cloud_functions_v1_OperationMetadataV1_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.OperationMetadataV1.class, + com.google.cloud.functions.v1.OperationMetadataV1.Builder.class); + } + + public static final int TARGET_FIELD_NUMBER = 1; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/locations/region-1/functions/function-1
+   * 
+ * + * string target = 1; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/locations/region-1/functions/function-1
+   * 
+ * + * string target = 1; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_; + /** + * + * + *
+   * Type of operation.
+   * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+   * Type of operation.
+   * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.functions.v1.OperationType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.OperationType result = + com.google.cloud.functions.v1.OperationType.valueOf(type_); + return result == null ? com.google.cloud.functions.v1.OperationType.UNRECOGNIZED : result; + } + + public static final int REQUEST_FIELD_NUMBER = 3; + private com.google.protobuf.Any request_; + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request = 3; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request = 3; + * + * @return The request. + */ + @java.lang.Override + public com.google.protobuf.Any getRequest() { + return request_ == null ? com.google.protobuf.Any.getDefaultInstance() : request_; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int VERSION_ID_FIELD_NUMBER = 4; + private long versionId_; + /** + * + * + *
+   * Version id of the function created or updated by an API call.
+   * This field is only populated for Create and Update operations.
+   * 
+ * + * int64 version_id = 4; + * + * @return The versionId. + */ + @java.lang.Override + public long getVersionId() { + return versionId_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The last update timestamp of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The last update timestamp of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The last update timestamp of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int BUILD_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object buildId_; + /** + * + * + *
+   * The Cloud Build ID of the function created or updated by an API call.
+   * This field is only populated for Create and Update operations.
+   * 
+ * + * string build_id = 6; + * + * @return The buildId. + */ + @java.lang.Override + public java.lang.String getBuildId() { + java.lang.Object ref = buildId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + buildId_ = s; + return s; + } + } + /** + * + * + *
+   * The Cloud Build ID of the function created or updated by an API call.
+   * This field is only populated for Create and Update operations.
+   * 
+ * + * string build_id = 6; + * + * @return The bytes for buildId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildIdBytes() { + java.lang.Object ref = buildId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, target_); + } + if (type_ != com.google.cloud.functions.v1.OperationType.OPERATION_UNSPECIFIED.getNumber()) { + output.writeEnum(2, type_); + } + if (request_ != null) { + output.writeMessage(3, getRequest()); + } + if (versionId_ != 0L) { + output.writeInt64(4, versionId_); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (!getBuildIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, buildId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, target_); + } + if (type_ != com.google.cloud.functions.v1.OperationType.OPERATION_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequest()); + } + if (versionId_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, versionId_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (!getBuildIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, buildId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.OperationMetadataV1)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.OperationMetadataV1 other = + (com.google.cloud.functions.v1.OperationMetadataV1) obj; + + if (!getTarget().equals(other.getTarget())) return false; + if (type_ != other.type_) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (getVersionId() != other.getVersionId()) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getBuildId().equals(other.getBuildId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getVersionId()); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + BUILD_ID_FIELD_NUMBER; + hash = (53 * hash) + getBuildId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.OperationMetadataV1 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Metadata describing an [Operation][google.longrunning.Operation]
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.OperationMetadataV1} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.OperationMetadataV1) + com.google.cloud.functions.v1.OperationMetadataV1OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsOperationsProto + .internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsOperationsProto + .internal_static_google_cloud_functions_v1_OperationMetadataV1_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.OperationMetadataV1.class, + com.google.cloud.functions.v1.OperationMetadataV1.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.OperationMetadataV1.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + target_ = ""; + + type_ = 0; + + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + versionId_ = 0L; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + buildId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsOperationsProto + .internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.OperationMetadataV1 getDefaultInstanceForType() { + return com.google.cloud.functions.v1.OperationMetadataV1.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.OperationMetadataV1 build() { + com.google.cloud.functions.v1.OperationMetadataV1 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.OperationMetadataV1 buildPartial() { + com.google.cloud.functions.v1.OperationMetadataV1 result = + new com.google.cloud.functions.v1.OperationMetadataV1(this); + result.target_ = target_; + result.type_ = type_; + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + result.versionId_ = versionId_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.buildId_ = buildId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.OperationMetadataV1) { + return mergeFrom((com.google.cloud.functions.v1.OperationMetadataV1) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.OperationMetadataV1 other) { + if (other == com.google.cloud.functions.v1.OperationMetadataV1.getDefaultInstance()) + return this; + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.getVersionId() != 0L) { + setVersionId(other.getVersionId()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getBuildId().isEmpty()) { + buildId_ = other.buildId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.OperationMetadataV1 parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.OperationMetadataV1) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/locations/region-1/functions/function-1
+     * 
+ * + * string target = 1; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/locations/region-1/functions/function-1
+     * 
+ * + * string target = 1; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/locations/region-1/functions/function-1
+     * 
+ * + * string target = 1; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/locations/region-1/functions/function-1
+     * 
+ * + * string target = 1; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Target of the operation - for example
+     * projects/project-1/locations/region-1/functions/function-1
+     * 
+ * + * string target = 1; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private int type_ = 0; + /** + * + * + *
+     * Type of operation.
+     * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + /** + * + * + *
+     * Type of operation.
+     * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Type of operation.
+     * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.cloud.functions.v1.OperationType getType() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.OperationType result = + com.google.cloud.functions.v1.OperationType.valueOf(type_); + return result == null ? com.google.cloud.functions.v1.OperationType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Type of operation.
+     * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.cloud.functions.v1.OperationType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of operation.
+     * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Any request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + requestBuilder_; + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + * + * @return The request. + */ + public com.google.protobuf.Any getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? com.google.protobuf.Any.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + public Builder setRequest(com.google.protobuf.Any value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + public Builder setRequest(com.google.protobuf.Any.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + public Builder mergeRequest(com.google.protobuf.Any value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = com.google.protobuf.Any.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + public com.google.protobuf.Any.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + public com.google.protobuf.AnyOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? com.google.protobuf.Any.getDefaultInstance() : request_; + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private long versionId_; + /** + * + * + *
+     * Version id of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * int64 version_id = 4; + * + * @return The versionId. + */ + @java.lang.Override + public long getVersionId() { + return versionId_; + } + /** + * + * + *
+     * Version id of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * int64 version_id = 4; + * + * @param value The versionId to set. + * @return This builder for chaining. + */ + public Builder setVersionId(long value) { + + versionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Version id of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * int64 version_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearVersionId() { + + versionId_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The last update timestamp of the operation.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object buildId_ = ""; + /** + * + * + *
+     * The Cloud Build ID of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * string build_id = 6; + * + * @return The buildId. + */ + public java.lang.String getBuildId() { + java.lang.Object ref = buildId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + buildId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Cloud Build ID of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * string build_id = 6; + * + * @return The bytes for buildId. + */ + public com.google.protobuf.ByteString getBuildIdBytes() { + java.lang.Object ref = buildId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + buildId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Cloud Build ID of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * string build_id = 6; + * + * @param value The buildId to set. + * @return This builder for chaining. + */ + public Builder setBuildId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + buildId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud Build ID of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * string build_id = 6; + * + * @return This builder for chaining. + */ + public Builder clearBuildId() { + + buildId_ = getDefaultInstance().getBuildId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Cloud Build ID of the function created or updated by an API call.
+     * This field is only populated for Create and Update operations.
+     * 
+ * + * string build_id = 6; + * + * @param value The bytes for buildId to set. + * @return This builder for chaining. + */ + public Builder setBuildIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + buildId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.OperationMetadataV1) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.OperationMetadataV1) + private static final com.google.cloud.functions.v1.OperationMetadataV1 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.OperationMetadataV1(); + } + + public static com.google.cloud.functions.v1.OperationMetadataV1 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadataV1 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadataV1(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.OperationMetadataV1 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationMetadataV1OrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationMetadataV1OrBuilder.java new file mode 100644 index 00000000..b14c24d4 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationMetadataV1OrBuilder.java @@ -0,0 +1,188 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/operations.proto + +package com.google.cloud.functions.v1; + +public interface OperationMetadataV1OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.OperationMetadataV1) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/locations/region-1/functions/function-1
+   * 
+ * + * string target = 1; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Target of the operation - for example
+   * projects/project-1/locations/region-1/functions/function-1
+   * 
+ * + * string target = 1; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Type of operation.
+   * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + * + * + *
+   * Type of operation.
+   * 
+ * + * .google.cloud.functions.v1.OperationType type = 2; + * + * @return The type. + */ + com.google.cloud.functions.v1.OperationType getType(); + + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request = 3; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request = 3; + * + * @return The request. + */ + com.google.protobuf.Any getRequest(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request = 3; + */ + com.google.protobuf.AnyOrBuilder getRequestOrBuilder(); + + /** + * + * + *
+   * Version id of the function created or updated by an API call.
+   * This field is only populated for Create and Update operations.
+   * 
+ * + * int64 version_id = 4; + * + * @return The versionId. + */ + long getVersionId(); + + /** + * + * + *
+   * The last update timestamp of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The last update timestamp of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The last update timestamp of the operation.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The Cloud Build ID of the function created or updated by an API call.
+   * This field is only populated for Create and Update operations.
+   * 
+ * + * string build_id = 6; + * + * @return The buildId. + */ + java.lang.String getBuildId(); + /** + * + * + *
+   * The Cloud Build ID of the function created or updated by an API call.
+   * This field is only populated for Create and Update operations.
+   * 
+ * + * string build_id = 6; + * + * @return The bytes for buildId. + */ + com.google.protobuf.ByteString getBuildIdBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationType.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationType.java new file mode 100644 index 00000000..69f5376e --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/OperationType.java @@ -0,0 +1,200 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/operations.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * A type of an operation.
+ * 
+ * + * Protobuf enum {@code google.cloud.functions.v1.OperationType} + */ +public enum OperationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unknown operation type.
+   * 
+ * + * OPERATION_UNSPECIFIED = 0; + */ + OPERATION_UNSPECIFIED(0), + /** + * + * + *
+   * Triggered by CreateFunction call
+   * 
+ * + * CREATE_FUNCTION = 1; + */ + CREATE_FUNCTION(1), + /** + * + * + *
+   * Triggered by UpdateFunction call
+   * 
+ * + * UPDATE_FUNCTION = 2; + */ + UPDATE_FUNCTION(2), + /** + * + * + *
+   * Triggered by DeleteFunction call.
+   * 
+ * + * DELETE_FUNCTION = 3; + */ + DELETE_FUNCTION(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unknown operation type.
+   * 
+ * + * OPERATION_UNSPECIFIED = 0; + */ + public static final int OPERATION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Triggered by CreateFunction call
+   * 
+ * + * CREATE_FUNCTION = 1; + */ + public static final int CREATE_FUNCTION_VALUE = 1; + /** + * + * + *
+   * Triggered by UpdateFunction call
+   * 
+ * + * UPDATE_FUNCTION = 2; + */ + public static final int UPDATE_FUNCTION_VALUE = 2; + /** + * + * + *
+   * Triggered by DeleteFunction call.
+   * 
+ * + * DELETE_FUNCTION = 3; + */ + public static final int DELETE_FUNCTION_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OperationType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OperationType forNumber(int value) { + switch (value) { + case 0: + return OPERATION_UNSPECIFIED; + case 1: + return CREATE_FUNCTION; + case 2: + return UPDATE_FUNCTION; + case 3: + return DELETE_FUNCTION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OperationType findValueByNumber(int number) { + return OperationType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsOperationsProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final OperationType[] VALUES = values(); + + public static OperationType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OperationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v1.OperationType) +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SourceRepository.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SourceRepository.java new file mode 100644 index 00000000..4970e50d --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SourceRepository.java @@ -0,0 +1,899 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Describes SourceRepository, used to represent parameters related to
+ * source repository where a function is hosted.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.SourceRepository} + */ +public final class SourceRepository extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.SourceRepository) + SourceRepositoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use SourceRepository.newBuilder() to construct. + private SourceRepository(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SourceRepository() { + url_ = ""; + deployedUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SourceRepository(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SourceRepository( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + deployedUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_SourceRepository_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_SourceRepository_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.SourceRepository.class, + com.google.cloud.functions.v1.SourceRepository.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + * + * + *
+   * The URL pointing to the hosted repository where the function is defined.
+   * There are supported Cloud Source Repository URLs in the following
+   * formats:
+   * To refer to a specific commit:
+   * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+   * To refer to a moveable alias (branch):
+   * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+   * In particular, to refer to HEAD use `master` moveable alias.
+   * To refer to a specific fixed alias (tag):
+   * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+   * You may omit `paths/*` if you want to use the main directory.
+   * 
+ * + * string url = 1; + * + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * + * + *
+   * The URL pointing to the hosted repository where the function is defined.
+   * There are supported Cloud Source Repository URLs in the following
+   * formats:
+   * To refer to a specific commit:
+   * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+   * To refer to a moveable alias (branch):
+   * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+   * In particular, to refer to HEAD use `master` moveable alias.
+   * To refer to a specific fixed alias (tag):
+   * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+   * You may omit `paths/*` if you want to use the main directory.
+   * 
+ * + * string url = 1; + * + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOYED_URL_FIELD_NUMBER = 2; + private volatile java.lang.Object deployedUrl_; + /** + * + * + *
+   * Output only. The URL pointing to the hosted repository where the function
+   * were defined at the time of deployment. It always points to a specific
+   * commit in the format described above.
+   * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The deployedUrl. + */ + @java.lang.Override + public java.lang.String getDeployedUrl() { + java.lang.Object ref = deployedUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URL pointing to the hosted repository where the function
+   * were defined at the time of deployment. It always points to a specific
+   * commit in the format described above.
+   * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for deployedUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDeployedUrlBytes() { + java.lang.Object ref = deployedUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (!getDeployedUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deployedUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + if (!getDeployedUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deployedUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.SourceRepository)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.SourceRepository other = + (com.google.cloud.functions.v1.SourceRepository) obj; + + if (!getUrl().equals(other.getUrl())) return false; + if (!getDeployedUrl().equals(other.getDeployedUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + DEPLOYED_URL_FIELD_NUMBER; + hash = (53 * hash) + getDeployedUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.SourceRepository parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.SourceRepository parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.SourceRepository parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.SourceRepository prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes SourceRepository, used to represent parameters related to
+   * source repository where a function is hosted.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.SourceRepository} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.SourceRepository) + com.google.cloud.functions.v1.SourceRepositoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_SourceRepository_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_SourceRepository_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.SourceRepository.class, + com.google.cloud.functions.v1.SourceRepository.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.SourceRepository.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + url_ = ""; + + deployedUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_SourceRepository_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepository getDefaultInstanceForType() { + return com.google.cloud.functions.v1.SourceRepository.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepository build() { + com.google.cloud.functions.v1.SourceRepository result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepository buildPartial() { + com.google.cloud.functions.v1.SourceRepository result = + new com.google.cloud.functions.v1.SourceRepository(this); + result.url_ = url_; + result.deployedUrl_ = deployedUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.SourceRepository) { + return mergeFrom((com.google.cloud.functions.v1.SourceRepository) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.SourceRepository other) { + if (other == com.google.cloud.functions.v1.SourceRepository.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (!other.getDeployedUrl().isEmpty()) { + deployedUrl_ = other.deployedUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.SourceRepository parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v1.SourceRepository) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + * + * + *
+     * The URL pointing to the hosted repository where the function is defined.
+     * There are supported Cloud Source Repository URLs in the following
+     * formats:
+     * To refer to a specific commit:
+     * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+     * To refer to a moveable alias (branch):
+     * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+     * In particular, to refer to HEAD use `master` moveable alias.
+     * To refer to a specific fixed alias (tag):
+     * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+     * You may omit `paths/*` if you want to use the main directory.
+     * 
+ * + * string url = 1; + * + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URL pointing to the hosted repository where the function is defined.
+     * There are supported Cloud Source Repository URLs in the following
+     * formats:
+     * To refer to a specific commit:
+     * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+     * To refer to a moveable alias (branch):
+     * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+     * In particular, to refer to HEAD use `master` moveable alias.
+     * To refer to a specific fixed alias (tag):
+     * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+     * You may omit `paths/*` if you want to use the main directory.
+     * 
+ * + * string url = 1; + * + * @return The bytes for url. + */ + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URL pointing to the hosted repository where the function is defined.
+     * There are supported Cloud Source Repository URLs in the following
+     * formats:
+     * To refer to a specific commit:
+     * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+     * To refer to a moveable alias (branch):
+     * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+     * In particular, to refer to HEAD use `master` moveable alias.
+     * To refer to a specific fixed alias (tag):
+     * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+     * You may omit `paths/*` if you want to use the main directory.
+     * 
+ * + * string url = 1; + * + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URL pointing to the hosted repository where the function is defined.
+     * There are supported Cloud Source Repository URLs in the following
+     * formats:
+     * To refer to a specific commit:
+     * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+     * To refer to a moveable alias (branch):
+     * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+     * In particular, to refer to HEAD use `master` moveable alias.
+     * To refer to a specific fixed alias (tag):
+     * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+     * You may omit `paths/*` if you want to use the main directory.
+     * 
+ * + * string url = 1; + * + * @return This builder for chaining. + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URL pointing to the hosted repository where the function is defined.
+     * There are supported Cloud Source Repository URLs in the following
+     * formats:
+     * To refer to a specific commit:
+     * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+     * To refer to a moveable alias (branch):
+     * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+     * In particular, to refer to HEAD use `master` moveable alias.
+     * To refer to a specific fixed alias (tag):
+     * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+     * You may omit `paths/*` if you want to use the main directory.
+     * 
+ * + * string url = 1; + * + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private java.lang.Object deployedUrl_ = ""; + /** + * + * + *
+     * Output only. The URL pointing to the hosted repository where the function
+     * were defined at the time of deployment. It always points to a specific
+     * commit in the format described above.
+     * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The deployedUrl. + */ + public java.lang.String getDeployedUrl() { + java.lang.Object ref = deployedUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + deployedUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URL pointing to the hosted repository where the function
+     * were defined at the time of deployment. It always points to a specific
+     * commit in the format described above.
+     * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for deployedUrl. + */ + public com.google.protobuf.ByteString getDeployedUrlBytes() { + java.lang.Object ref = deployedUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + deployedUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URL pointing to the hosted repository where the function
+     * were defined at the time of deployment. It always points to a specific
+     * commit in the format described above.
+     * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The deployedUrl to set. + * @return This builder for chaining. + */ + public Builder setDeployedUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + deployedUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL pointing to the hosted repository where the function
+     * were defined at the time of deployment. It always points to a specific
+     * commit in the format described above.
+     * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDeployedUrl() { + + deployedUrl_ = getDefaultInstance().getDeployedUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL pointing to the hosted repository where the function
+     * were defined at the time of deployment. It always points to a specific
+     * commit in the format described above.
+     * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for deployedUrl to set. + * @return This builder for chaining. + */ + public Builder setDeployedUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + deployedUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.SourceRepository) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.SourceRepository) + private static final com.google.cloud.functions.v1.SourceRepository DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.SourceRepository(); + } + + public static com.google.cloud.functions.v1.SourceRepository getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceRepository parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceRepository(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.SourceRepository getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SourceRepositoryOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SourceRepositoryOrBuilder.java new file mode 100644 index 00000000..9cd5604d --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SourceRepositoryOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface SourceRepositoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.SourceRepository) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The URL pointing to the hosted repository where the function is defined.
+   * There are supported Cloud Source Repository URLs in the following
+   * formats:
+   * To refer to a specific commit:
+   * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+   * To refer to a moveable alias (branch):
+   * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+   * In particular, to refer to HEAD use `master` moveable alias.
+   * To refer to a specific fixed alias (tag):
+   * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+   * You may omit `paths/*` if you want to use the main directory.
+   * 
+ * + * string url = 1; + * + * @return The url. + */ + java.lang.String getUrl(); + /** + * + * + *
+   * The URL pointing to the hosted repository where the function is defined.
+   * There are supported Cloud Source Repository URLs in the following
+   * formats:
+   * To refer to a specific commit:
+   * `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*`
+   * To refer to a moveable alias (branch):
+   * `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*`
+   * In particular, to refer to HEAD use `master` moveable alias.
+   * To refer to a specific fixed alias (tag):
+   * `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*`
+   * You may omit `paths/*` if you want to use the main directory.
+   * 
+ * + * string url = 1; + * + * @return The bytes for url. + */ + com.google.protobuf.ByteString getUrlBytes(); + + /** + * + * + *
+   * Output only. The URL pointing to the hosted repository where the function
+   * were defined at the time of deployment. It always points to a specific
+   * commit in the format described above.
+   * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The deployedUrl. + */ + java.lang.String getDeployedUrl(); + /** + * + * + *
+   * Output only. The URL pointing to the hosted repository where the function
+   * were defined at the time of deployment. It always points to a specific
+   * commit in the format described above.
+   * 
+ * + * string deployed_url = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for deployedUrl. + */ + com.google.protobuf.ByteString getDeployedUrlBytes(); +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java new file mode 100644 index 00000000..781fd71a --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java @@ -0,0 +1,1030 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +/** + * + * + *
+ * Request for the `UpdateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v1.UpdateFunctionRequest} + */ +public final class UpdateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v1.UpdateFunctionRequest) + UpdateFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFunctionRequest.newBuilder() to construct. + private UpdateFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFunctionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v1.CloudFunction.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v1.CloudFunction.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.UpdateFunctionRequest.class, + com.google.cloud.functions.v1.UpdateFunctionRequest.Builder.class); + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + private com.google.cloud.functions.v1.CloudFunction function_; + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return function_ != null; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction getFunction() { + return function_ == null + ? com.google.cloud.functions.v1.CloudFunction.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (function_ != null) { + output.writeMessage(1, getFunction()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFunction()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v1.UpdateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v1.UpdateFunctionRequest other = + (com.google.cloud.functions.v1.UpdateFunctionRequest) obj; + + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v1.UpdateFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `UpdateFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v1.UpdateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v1.UpdateFunctionRequest) + com.google.cloud.functions.v1.UpdateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v1.UpdateFunctionRequest.class, + com.google.cloud.functions.v1.UpdateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v1.UpdateFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v1.FunctionsProto + .internal_static_google_cloud_functions_v1_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v1.UpdateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v1.UpdateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v1.UpdateFunctionRequest build() { + com.google.cloud.functions.v1.UpdateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v1.UpdateFunctionRequest buildPartial() { + com.google.cloud.functions.v1.UpdateFunctionRequest result = + new com.google.cloud.functions.v1.UpdateFunctionRequest(this); + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v1.UpdateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v1.UpdateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v1.UpdateFunctionRequest other) { + if (other == com.google.cloud.functions.v1.UpdateFunctionRequest.getDefaultInstance()) + return this; + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v1.UpdateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v1.UpdateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v1.CloudFunction function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The function. + */ + public com.google.cloud.functions.v1.CloudFunction getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v1.CloudFunction.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setFunction(com.google.cloud.functions.v1.CloudFunction value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setFunction( + com.google.cloud.functions.v1.CloudFunction.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder mergeFunction(com.google.cloud.functions.v1.CloudFunction value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v1.CloudFunction.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = null; + onChanged(); + } else { + function_ = null; + functionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.cloud.functions.v1.CloudFunction.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v1.CloudFunction.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v1.CloudFunction, + com.google.cloud.functions.v1.CloudFunction.Builder, + com.google.cloud.functions.v1.CloudFunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required list of fields to be updated in this request.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v1.UpdateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v1.UpdateFunctionRequest) + private static final com.google.cloud.functions.v1.UpdateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v1.UpdateFunctionRequest(); + } + + public static com.google.cloud.functions.v1.UpdateFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v1.UpdateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..35914559 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v1/functions.proto + +package com.google.cloud.functions.v1; + +public interface UpdateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v1.UpdateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The function. + */ + com.google.cloud.functions.v1.CloudFunction getFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v1.CloudFunction function = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * Required list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required list of fields to be updated in this request.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto new file mode 100644 index 00000000..97f40254 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto @@ -0,0 +1,618 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.functions.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v1;functions"; +option java_multiple_files = true; +option java_outer_classname = "FunctionsProto"; +option java_package = "com.google.cloud.functions.v1"; +option objc_class_prefix = "GCF"; + +// A service that application uses to manipulate triggers and functions. +service CloudFunctionsService { + option (google.api.default_host) = "cloudfunctions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of functions that belong to the requested project. + rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/functions" + }; + } + + // Returns a function with the given name from the requested project. + rpc GetFunction(GetFunctionRequest) returns (CloudFunction) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{location=projects/*/locations/*}/functions" + body: "function" + }; + option (google.api.method_signature) = "location,function"; + option (google.longrunning.operation_info) = { + response_type: "CloudFunction" + metadata_type: "OperationMetadataV1" + }; + } + + // Updates existing function. + rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{function.name=projects/*/locations/*/functions/*}" + body: "function" + }; + option (google.api.method_signature) = "function"; + option (google.longrunning.operation_info) = { + response_type: "CloudFunction" + metadata_type: "OperationMetadataV1" + }; + } + + // 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. + rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadataV1" + }; + } + + // Synchronously invokes a deployed Cloud Function. To be used for testing + // purposes as very limited traffic is allowed. For more information on + // the actual limits, refer to + // [Rate Limits](https://cloud.google.com/functions/quotas#rate_limits). + rpc CallFunction(CallFunctionRequest) returns (CallFunctionResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/functions/*}:call" + body: "*" + }; + option (google.api.method_signature) = "name,data"; + } + + // Returns a signed URL for uploading a function source code. + // For more information about the signed URL usage see: + // https://cloud.google.com/storage/docs/access-control/signed-urls. + // Once the function source code upload is complete, the used signed + // URL should be provided in CreateFunction or UpdateFunction request + // as a reference to the function source code. + // + // When uploading source code to the generated signed URL, please follow + // these restrictions: + // + // * Source file type should be a zip file. + // * Source file size should not exceed 100MB limit. + // * No credentials should be attached - the signed URLs provide access to the + // target bucket using internal service identity; if credentials were + // attached, the identity from the credentials would be used, but that + // identity does not have permissions to upload files to the URL. + // + // When making a HTTP PUT request, these two headers need to be specified: + // + // * `content-type: application/zip` + // * `x-goog-content-length-range: 0,104857600` + // + // And this header SHOULD NOT be specified: + // + // * `Authorization: Bearer YOUR_TOKEN` + rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/functions:generateUploadUrl" + body: "*" + }; + } + + // Returns a signed URL for downloading deployed function source code. + // The URL is only valid for a 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 + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" + body: "*" + }; + } + + // Sets the IAM access control policy on the specified function. + // Replaces any existing policy. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/functions/*}:setIamPolicy" + body: "*" + }; + } + + // Gets the IAM access control policy for a function. + // Returns an empty policy if the function exists and does not have a policy + // set. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + get: "/v1/{resource=projects/*/locations/*/functions/*}:getIamPolicy" + }; + } + + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/locations/*/functions/*}:testIamPermissions" + body: "*" + }; + } +} + +// Describes a Cloud Function that contains user computation executed in +// response to an event. It encapsulate function and triggers configurations. +message CloudFunction { + option (google.api.resource) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + pattern: "projects/{project}/locations/{location}/functions/{function}" + }; + + // Available egress settings. + // + // This controls what traffic is diverted through the VPC Access Connector + // resource. By default PRIVATE_RANGES_ONLY will be used. + enum VpcConnectorEgressSettings { + // Unspecified. + VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + + // Use the VPC Access Connector only for private IP space from RFC1918. + PRIVATE_RANGES_ONLY = 1; + + // Force the use of VPC Access Connector for all egress traffic from the + // function. + ALL_TRAFFIC = 2; + } + + // Available ingress settings. + // + // This controls what traffic can reach the function. + // + // If unspecified, ALLOW_ALL will be used. + enum IngressSettings { + // Unspecified. + INGRESS_SETTINGS_UNSPECIFIED = 0; + + // Allow HTTP traffic from public and private sources. + ALLOW_ALL = 1; + + // Allow HTTP traffic from only private VPC sources. + ALLOW_INTERNAL_ONLY = 2; + + // Allow HTTP traffic from private VPC sources and through GCLB. + ALLOW_INTERNAL_AND_GCLB = 3; + } + + // A user-defined name of the function. Function names must be unique + // globally and match pattern `projects/*/locations/*/functions/*` + string name = 1; + + // User-provided description of a function. + string description = 2; + + // The location of the function source code. + oneof source_code { + // The Google Cloud Storage URL, starting with gs://, pointing to the zip + // archive which contains the function. + string source_archive_url = 3; + + // **Beta Feature** + // + // The source repository where a function is hosted. + SourceRepository source_repository = 4; + + // The Google Cloud Storage signed URL used for source uploading, generated + // by [google.cloud.functions.v1.GenerateUploadUrl][] + string source_upload_url = 16; + } + + // An event that triggers the function. + oneof trigger { + // An HTTPS endpoint type of source that can be triggered via URL. + HttpsTrigger https_trigger = 5; + + // A source that fires events in response to a condition in another service. + EventTrigger event_trigger = 6; + } + + // Output only. Status of the function deployment. + CloudFunctionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The name of the function (as defined in source code) that will be + // executed. Defaults to the resource name suffix, if not specified. For + // backward compatibility, if function with given name is not found, then the + // system will try to use function named "function". + // For Node.js this is name of a function exported by the module specified + // in `source_location`. + string entry_point = 8; + + // The runtime in which to run the function. Required when deploying a new + // function, optional when updating an existing function. For a complete + // list of possible choices, see the + // [`gcloud` command + // reference](/sdk/gcloud/reference/functions/deploy#--runtime). + string runtime = 19; + + // The function execution timeout. Execution is considered failed and + // can be terminated if the function is not completed at the end of the + // timeout period. Defaults to 60 seconds. + google.protobuf.Duration timeout = 9; + + // The amount of memory in MB available for a function. + // Defaults to 256MB. + int32 available_memory_mb = 10; + + // The email of the function's service account. If empty, defaults to + // `{project_id}@appspot.gserviceaccount.com`. + string service_account_email = 11; + + // Output only. The last update timestamp of a Cloud Function. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version identifier of the Cloud Function. Each deployment attempt + // results in a new version of a function being created. + int64 version_id = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this Cloud Function. + map labels = 15; + + // Environment variables that shall be available during function execution. + map environment_variables = 17; + + // The VPC Network that this cloud function can connect to. It can be + // either the fully-qualified URI, or the short name of the network resource. + // If the short network name is used, the network must belong to the same + // project. Otherwise, it must belong to a project within the same + // organization. The format of this field is either + // `projects/{project}/global/networks/{network}` or `{network}`, where + // {project} is a project id where the network is defined, and {network} is + // the short name of the network. + // + // This field is mutually exclusive with `vpc_connector` and will be replaced + // by it. + // + // See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for + // more information on connecting Cloud projects. + string network = 18; + + // The limit on the maximum number of function instances that may coexist at a + // given time. + int32 max_instances = 20; + + // The VPC Network Connector that this cloud function can connect to. It can + // be either the fully-qualified URI, or the short name of the network + // connector resource. The format of this field is + // `projects/*/locations/*/connectors/*` + // + // This field is mutually exclusive with `network` field and will eventually + // replace it. + // + // See [the VPC documentation](https://cloud.google.com/compute/docs/vpc) for + // more information on connecting Cloud projects. + string vpc_connector = 22; + + // The egress settings for the connector, controlling what traffic is diverted + // through it. + VpcConnectorEgressSettings vpc_connector_egress_settings = 23; + + // The ingress settings for the function, controlling what traffic can reach + // it. + IngressSettings ingress_settings = 24; + + // Output only. The Cloud Build ID of the latest successful deployment of the + // function. + string build_id = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes SourceRepository, used to represent parameters related to +// source repository where a function is hosted. +message SourceRepository { + // The URL pointing to the hosted repository where the function is defined. + // There are supported Cloud Source Repository URLs in the following + // formats: + // + // To refer to a specific commit: + // `https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/*` + // To refer to a moveable alias (branch): + // `https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/*` + // In particular, to refer to HEAD use `master` moveable alias. + // To refer to a specific fixed alias (tag): + // `https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*` + // + // You may omit `paths/*` if you want to use the main directory. + string url = 1; + + // Output only. The URL pointing to the hosted repository where the function + // were defined at the time of deployment. It always points to a specific + // commit in the format described above. + string deployed_url = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes HttpsTrigger, could be used to connect web hooks to function. +message HttpsTrigger { + // Output only. The deployed url for the function. + string url = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes EventTrigger, used to request events be sent from another +// service. +message EventTrigger { + // Required. The type of event to observe. For example: + // `providers/cloud.storage/eventTypes/object.change` and + // `providers/cloud.pubsub/eventTypes/topic.publish`. + // + // Event types match pattern `providers/*/eventTypes/*.*`. + // The pattern contains: + // + // 1. namespace: For example, `cloud.storage` and + // `google.firebase.analytics`. + // 2. resource type: The type of resource on which event occurs. For + // example, the Google Cloud Storage API includes the type `object`. + // 3. action: The action that generates the event. For example, action for + // a Google Cloud Storage Object is 'change'. + // These parts are lower case. + string event_type = 1; + + // Required. The resource(s) from which to observe events, for example, + // `projects/_/buckets/myBucket`. + // + // Not all syntactically correct values are accepted by all services. For + // example: + // + // 1. The authorization model must support it. Google Cloud Functions + // only allows EventTriggers to be deployed that observe resources in the + // same project as the `CloudFunction`. + // 2. The resource type must match the pattern expected for an + // `event_type`. For example, an `EventTrigger` that has an + // `event_type` of "google.pubsub.topic.publish" should have a resource + // that matches Google Cloud Pub/Sub topics. + // + // Additionally, some services may support short names when creating an + // `EventTrigger`. These will always be returned in the normalized "long" + // format. + // + // See each *service's* documentation for supported formats. + string resource = 2; + + // The hostname of the service that should be observed. + // + // If no string is provided, the default service implementing the API will + // be used. For example, `storage.googleapis.com` is the default for all + // event types in the `google.storage` namespace. + string service = 3; + + // Specifies policy for failed executions. + FailurePolicy failure_policy = 5; +} + +// Describes the policy in case of function's execution failure. +// If empty, then defaults to ignoring failures (i.e. not retrying them). +message FailurePolicy { + // Describes the retry policy in case of function's execution failure. + // A function execution will be retried on any failure. + // A failed execution will be retried up to 7 days with an exponential backoff + // (capped at 10 seconds). + // Retried execution is charged as any other execution. + message Retry { + + } + + // Defines the action taken in case of a function execution failure. + oneof action { + // If specified, then the function will be retried in case of a failure. + Retry retry = 1; + } +} + +// Request for the `CreateFunction` method. +message CreateFunctionRequest { + // Required. The project and location in which the function should be created, specified + // in the format `projects/*/locations/*` + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Function to be created. + CloudFunction function = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for the `UpdateFunction` method. +message UpdateFunctionRequest { + // Required. New version of the function. + CloudFunction function = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + } + ]; + + // Required list of fields to be updated in this request. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for the `GetFunction` method. +message GetFunctionRequest { + // Required. The name of the function which details should be obtained. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + } + ]; +} + +// Describes the current stage of a deployment. +enum CloudFunctionStatus { + // Not specified. Invalid state. + CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0; + + // Function has been successfully deployed and is serving. + ACTIVE = 1; + + // Function deployment failed and the function isn’t serving. + OFFLINE = 2; + + // Function is being created or updated. + DEPLOY_IN_PROGRESS = 3; + + // Function is being deleted. + DELETE_IN_PROGRESS = 4; + + // Function deployment failed and the function serving state is undefined. + // The function should be updated or deleted to move it out of this state. + UNKNOWN = 5; +} + +// Request for the `ListFunctions` method. +message ListFunctionsRequest { + // The project and location from which the function should be listed, + // specified in the format `projects/*/locations/*` + // If you want to list functions in all locations, use "-" in place of a + // location. When listing functions in all locations, if one or more + // location(s) are unreachable, the response will contain functions from all + // reachable locations along with the names of any unreachable locations. + string parent = 1 [(google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + }]; + + // Maximum number of functions to return per call. + int32 page_size = 2; + + // The value returned by the last + // `ListFunctionsResponse`; indicates that + // this is a continuation of a prior `ListFunctions` call, and that the + // system should return the next page of data. + string page_token = 3; +} + +// Response for the `ListFunctions` method. +message ListFunctionsResponse { + // The functions that match the request. + repeated CloudFunction functions = 1; + + // If not empty, indicates that there may be more functions that match + // the request; this value should be passed in a new + // [google.cloud.functions.v1.ListFunctionsRequest][google.cloud.functions.v1.ListFunctionsRequest] + // to get more functions. + string next_page_token = 2; + + // Locations that could not be reached. The response does not include any + // functions from these locations. + repeated string unreachable = 3; +} + +// Request for the `DeleteFunction` method. +message DeleteFunctionRequest { + // Required. The name of the function which should be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + } + ]; +} + +// Request for the `CallFunction` method. +message CallFunctionRequest { + // Required. The name of the function to be called. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/CloudFunction" + } + ]; + + // Required. Input to be passed to the function. + string data = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of `CallFunction` method. +message CallFunctionResponse { + // Execution id of function invocation. + string execution_id = 1; + + // Result populated for successful execution of synchronous function. Will + // not be populated if function does not return a result through context. + string result = 2; + + // Either system or user-function generated error. Set if execution + // was not successful. + string error = 3; +} + +// Request of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlRequest { + // The project and location in which the Google Cloud Storage signed URL + // should be generated, specified in the format `projects/*/locations/*`. + string parent = 1; +} + +// Response of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlResponse { + // The generated Google Cloud Storage signed URL that should be used for a + // function source code upload. The uploaded file should be a zip archive + // which contains a function. + string upload_url = 1; +} + +// Request of `GenerateDownloadUrl` method. +message GenerateDownloadUrlRequest { + // The name of function for which source code Google Cloud Storage signed + // URL should be generated. + string name = 1; + + // The optional version of function. If not set, default, current version + // is used. + uint64 version_id = 2; +} + +// Response of `GenerateDownloadUrl` method. +message GenerateDownloadUrlResponse { + // The generated Google Cloud Storage signed URL that should be used for + // function source code download. + string download_url = 1; +} diff --git a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto new file mode 100644 index 00000000..053ee013 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto @@ -0,0 +1,65 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.functions.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v1;functions"; +option java_multiple_files = true; +option java_outer_classname = "FunctionsOperationsProto"; +option java_package = "com.google.cloud.functions.v1"; + +// A type of an operation. +enum OperationType { + // Unknown operation type. + OPERATION_UNSPECIFIED = 0; + + // Triggered by CreateFunction call + CREATE_FUNCTION = 1; + + // Triggered by UpdateFunction call + UPDATE_FUNCTION = 2; + + // Triggered by DeleteFunction call. + DELETE_FUNCTION = 3; +} + +// Metadata describing an [Operation][google.longrunning.Operation] +message OperationMetadataV1 { + // Target of the operation - for example + // projects/project-1/locations/region-1/functions/function-1 + string target = 1; + + // Type of operation. + OperationType type = 2; + + // The original request that started the operation. + google.protobuf.Any request = 3; + + // Version id of the function created or updated by an API call. + // This field is only populated for Create and Update operations. + int64 version_id = 4; + + // The last update timestamp of the operation. + google.protobuf.Timestamp update_time = 5; + + // The Cloud Build ID of the function created or updated by an API call. + // This field is only populated for Create and Update operations. + string build_id = 6; +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..bc485896 --- /dev/null +++ b/renovate.json @@ -0,0 +1,81 @@ +{ + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "packageRules": [ + { + "packagePatterns": [ + "^com.google.guava:" + ], + "versionScheme": "docker" + }, + { + "packagePatterns": [ + "^com.google.api:gax", + "^com.google.auth:", + "^com.google.cloud:google-cloud-core", + "^io.grpc:", + "^com.google.guava:" + ], + "groupName": "core dependencies" + }, + { + "packagePatterns": [ + "^com.google.http-client:", + "^com.google.oauth-client:", + "^com.google.api-client:" + ], + "groupName": "core transport dependencies" + }, + { + "packagePatterns": [ + "*" + ], + "semanticCommitType": "deps", + "semanticCommitScope": null + }, + { + "packagePatterns": [ + "^org.apache.maven", + "^org.jacoco:", + "^org.codehaus.mojo:", + "^org.sonatype.plugins:", + "^com.coveo:", + "^com.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-functions", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "masterIssue": true +} \ No newline at end of file diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml new file mode 100644 index 00000000..72de1b21 --- /dev/null +++ b/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + functions-install-without-bom + jar + Google Cloud Functions Install Without Bom + https://github.com/googleapis/java-functions + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-functions + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/samples/pom.xml b/samples/pom.xml new file mode 100644 index 00000000..b88a5788 --- /dev/null +++ b/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud-functions-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Functions Samples Parent + https://github.com/googleapis/java-functions + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.0.18 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + + true + + + + + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml new file mode 100644 index 00000000..2647ea21 --- /dev/null +++ b/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + functions-snapshot + jar + Google Cloud Functions Snapshot Samples + https://github.com/googleapis/java-functions + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-functions + 0.0.0 + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.1.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + \ No newline at end of file diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml new file mode 100644 index 00000000..d94483ad --- /dev/null +++ b/samples/snippets/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + com.google.cloud + functions-snippets + jar + Google Cloud Functions Snippets + https://github.com/googleapis/java-functions + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + + com.google.cloud + libraries-bom + 8.1.0 + pom + import + + + + + + + com.google.cloud + google-cloud-functions + + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..bdab6f1a --- /dev/null +++ b/synth.metadata @@ -0,0 +1,29 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "sso://devrel/cloud/libraries/java/repo-splitter", + "sha": "675497fd5cb08180b14228cbcdf5a5716083f540" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "3a89215abd0e66dfc4f21d07d552d0b543abf082" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "functions", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..ef59a786 --- /dev/null +++ b/synth.py @@ -0,0 +1,32 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +service = 'functions' +versions = ['v1'] + +for version in versions: + java.bazel_library( + service=service, + version=version, + proto_path=f'google/cloud/{service}/{version}', + bazel_target=f'//google/cloud/{service}/{version}:google-cloud-{service}-{version}-java', + ) + +java.common_templates() \ No newline at end of file diff --git a/versions.txt b/versions.txt new file mode 100644 index 00000000..8c4b8155 --- /dev/null +++ b/versions.txt @@ -0,0 +1,6 @@ +# Format: +# module:released-version:current-version + +google-cloud-functions:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-functions-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-functions-v1:0.0.0:0.0.1-SNAPSHOT \ No newline at end of file