From 3c6f8aca93596ad7fac8970bfbb69feb5aeab468 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 18 Jul 2022 18:18:12 +0200 Subject: [PATCH 01/10] build(deps): update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.4.0 (#447) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-project-info-reports-plugin](https://maven.apache.org/plugins/) | `3.3.0` -> `3.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/compatibility-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-project-info-reports-plugin/3.4.0/confidence-slim/3.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-functions). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2d18539..1befb4e0 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.3.0 + 3.4.0 From ae541c06e14fbcc72ada29cd84146a116edcb7c5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 19 Jul 2022 13:36:34 +0000 Subject: [PATCH 02/10] ci: update template so GAPIC_AUTO repos do not require special approvers for Java code (#1494) (#448) Source-Link: https://github.com/googleapis/synthtool/commit/da89e53878d92467eb648c610e64f94a614915cc Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:04f254abfe5f47fe73ae6f91d68d55c3b76e722a4943066c3bb0ce03573b4ad9 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/CODEOWNERS | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index de9173d9..6610882f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:d4b80feffe1579818cdc39466152e9de95789a193408506cd4a1ffbe8804dc00 -# created: 2022-07-13T13:53:17.676447481Z + digest: sha256:04f254abfe5f47fe73ae6f91d68d55c3b76e722a4943066c3bb0ce03573b4ad9 +# created: 2022-07-18T21:44:23.94208526Z diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5f9903d5..1578dc2f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,7 +6,7 @@ # The @googleapis/aap-dpes is the default owner for changes in this repo * @googleapis/yoshi-java @googleapis/aap-dpes -**/*.java @googleapis/aap-dpes + # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers From 601ddc30d5d728f088456291074ba9ec6707c252 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 19 Jul 2022 19:30:23 +0200 Subject: [PATCH 03/10] build(deps): update dependency org.apache.maven.plugins:maven-deploy-plugin to v3 (#449) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.apache.maven.plugins:maven-deploy-plugin](https://maven.apache.org/plugins/) | `2.8.2` -> `3.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/compatibility-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.apache.maven.plugins:maven-deploy-plugin/3.0.0/confidence-slim/2.8.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-functions). --- samples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/pom.xml b/samples/pom.xml index e81cdd44..c2a42296 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -38,7 +38,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.0.0 true From d56a252c7297e57d41f00b676c4bdf0b5f23eb97 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 19 Jul 2022 18:30:14 +0000 Subject: [PATCH 04/10] feat: generating GAPIC libraries for Google Cloud Functions v2beta (#441) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 459309277 Source-Link: https://github.com/googleapis/googleapis/commit/2844793f71df766526ceeee8a35c90d7ac101fbe Source-Link: https://github.com/googleapis/googleapis-gen/commit/319987cc0e8789a368e34882271a92b0717c9c8f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzE5OTg3Y2MwZTg3ODlhMzY4ZTM0ODgyMjcxYTkyYjA3MTdjOWM4ZiJ9 --- google-cloud-functions-bom/pom.xml | 10 + google-cloud-functions/pom.xml | 9 + .../functions/v2/FunctionServiceClient.java | 1582 +++++++ .../functions/v2/FunctionServiceSettings.java | 376 ++ .../cloud/functions/v2/gapic_metadata.json | 54 + .../cloud/functions/v2/package-info.java | 45 + .../v2/stub/FunctionServiceStub.java | 146 + .../v2/stub/FunctionServiceStubSettings.java | 864 ++++ .../GrpcFunctionServiceCallableFactory.java | 113 + .../v2/stub/GrpcFunctionServiceStub.java | 584 +++ ...ttpJsonFunctionServiceCallableFactory.java | 105 + .../v2/stub/HttpJsonFunctionServiceStub.java | 875 ++++ .../v2/FunctionServiceClientHttpJsonTest.java | 1006 ++++ .../v2/FunctionServiceClientTest.java | 918 ++++ .../functions/v2/MockFunctionService.java | 59 + .../functions/v2/MockFunctionServiceImpl.java | 230 + .../cloud/functions/v2/MockIAMPolicy.java | 59 + .../cloud/functions/v2/MockIAMPolicyImpl.java | 127 + .../cloud/functions/v2/MockLocations.java | 59 + .../cloud/functions/v2/MockLocationsImpl.java | 83 + grpc-google-cloud-functions-v2/pom.xml | 69 + .../functions/v2/FunctionServiceGrpc.java | 1296 ++++++ pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-functions-v2/pom.xml | 42 + .../cloud/functions/v2/BuildConfig.java | 2508 ++++++++++ .../functions/v2/BuildConfigOrBuilder.java | 351 ++ .../functions/v2/CreateFunctionRequest.java | 1160 +++++ .../v2/CreateFunctionRequestOrBuilder.java | 128 + .../functions/v2/DeleteFunctionRequest.java | 652 +++ .../v2/DeleteFunctionRequestOrBuilder.java | 54 + .../cloud/functions/v2/Environment.java | 176 + .../cloud/functions/v2/EventFilter.java | 1015 ++++ .../functions/v2/EventFilterOrBuilder.java | 106 + .../cloud/functions/v2/EventTrigger.java | 2521 ++++++++++ .../functions/v2/EventTriggerOrBuilder.java | 302 ++ .../google/cloud/functions/v2/Function.java | 3393 ++++++++++++++ .../cloud/functions/v2/FunctionName.java | 223 + .../cloud/functions/v2/FunctionOrBuilder.java | 404 ++ .../cloud/functions/v2/FunctionsProto.java | 747 +++ .../v2/GenerateDownloadUrlRequest.java | 660 +++ .../GenerateDownloadUrlRequestOrBuilder.java | 56 + .../v2/GenerateDownloadUrlResponse.java | 646 +++ .../GenerateDownloadUrlResponseOrBuilder.java | 52 + .../v2/GenerateUploadUrlRequest.java | 660 +++ .../v2/GenerateUploadUrlRequestOrBuilder.java | 56 + .../v2/GenerateUploadUrlResponse.java | 991 ++++ .../GenerateUploadUrlResponseOrBuilder.java | 104 + .../functions/v2/GetFunctionRequest.java | 651 +++ .../v2/GetFunctionRequestOrBuilder.java | 54 + .../functions/v2/ListFunctionsRequest.java | 1356 ++++++ .../v2/ListFunctionsRequestOrBuilder.java | 164 + .../functions/v2/ListFunctionsResponse.java | 1426 ++++++ .../v2/ListFunctionsResponseOrBuilder.java | 159 + .../functions/v2/ListRuntimesRequest.java | 845 ++++ .../v2/ListRuntimesRequestOrBuilder.java | 83 + .../functions/v2/ListRuntimesResponse.java | 2778 +++++++++++ .../v2/ListRuntimesResponseOrBuilder.java | 78 + .../cloud/functions/v2/LocationName.java | 192 + .../cloud/functions/v2/OperationMetadata.java | 2581 ++++++++++ .../v2/OperationMetadataOrBuilder.java | 297 ++ .../google/cloud/functions/v2/RepoSource.java | 1935 ++++++++ .../functions/v2/RepoSourceOrBuilder.java | 247 + .../cloud/functions/v2/SecretEnvVar.java | 1212 +++++ .../functions/v2/SecretEnvVarOrBuilder.java | 135 + .../cloud/functions/v2/SecretVolume.java | 2502 ++++++++++ .../functions/v2/SecretVolumeOrBuilder.java | 174 + .../cloud/functions/v2/ServiceConfig.java | 4130 +++++++++++++++++ .../functions/v2/ServiceConfigOrBuilder.java | 499 ++ .../com/google/cloud/functions/v2/Source.java | 1151 +++++ .../cloud/functions/v2/SourceOrBuilder.java | 100 + .../cloud/functions/v2/SourceProvenance.java | 1040 +++++ .../v2/SourceProvenanceOrBuilder.java | 101 + .../com/google/cloud/functions/v2/Stage.java | 2214 +++++++++ .../cloud/functions/v2/StageOrBuilder.java | 202 + .../cloud/functions/v2/StateMessage.java | 1150 +++++ .../functions/v2/StateMessageOrBuilder.java | 100 + .../cloud/functions/v2/StorageSource.java | 937 ++++ .../functions/v2/StorageSourceOrBuilder.java | 97 + .../functions/v2/UpdateFunctionRequest.java | 1055 +++++ .../v2/UpdateFunctionRequestOrBuilder.java | 107 + .../google/cloud/functions/v2/functions.proto | 1037 +++++ ...ncCallFunctionCloudfunctionnameString.java | 6 +- ...eateFunctionLocationnameCloudfunction.java | 6 +- ...SyncCreateFunctionStringCloudfunction.java | 3 +- .../deletefunction/SyncDeleteFunction.java | 1 + .../SyncDeleteFunctionCloudfunctionname.java | 1 + .../SyncDeleteFunctionString.java | 1 + .../SyncCreateSetCredentialsProvider.java | 42 + .../SyncCreateSetCredentialsProvider1.java | 41 + .../create/SyncCreateSetEndpoint.java | 39 + .../createfunction/AsyncCreateFunction.java | 50 + .../AsyncCreateFunctionLRO.java | 50 + .../createfunction/SyncCreateFunction.java | 45 + ...ateFunctionLocationnameFunctionString.java | 42 + ...yncCreateFunctionStringFunctionString.java | 42 + .../deletefunction/AsyncDeleteFunction.java | 47 + .../AsyncDeleteFunctionLRO.java | 48 + .../deletefunction/SyncDeleteFunction.java | 43 + .../SyncDeleteFunctionFunctionname.java | 39 + .../SyncDeleteFunctionString.java | 39 + .../AsyncGenerateDownloadUrl.java | 47 + .../SyncGenerateDownloadUrl.java | 43 + .../AsyncGenerateUploadUrl.java | 47 + .../SyncGenerateUploadUrl.java | 43 + .../getfunction/AsyncGetFunction.java | 46 + .../getfunction/SyncGetFunction.java | 43 + .../SyncGetFunctionFunctionname.java | 39 + .../getfunction/SyncGetFunctionString.java | 39 + .../getiampolicy/AsyncGetIamPolicy.java | 48 + .../getiampolicy/SyncGetIamPolicy.java | 45 + .../listfunctions/AsyncListFunctions.java | 53 + .../AsyncListFunctionsPaged.java | 61 + .../listfunctions/SyncListFunctions.java | 49 + .../SyncListFunctionsLocationname.java | 41 + .../SyncListFunctionsString.java | 41 + .../listlocations/AsyncListLocations.java | 51 + .../AsyncListLocationsPaged.java | 59 + .../listlocations/SyncListLocations.java | 47 + .../listruntimes/AsyncListRuntimes.java | 48 + .../listruntimes/SyncListRuntimes.java | 44 + .../SyncListRuntimesLocationname.java | 39 + .../listruntimes/SyncListRuntimesString.java | 39 + .../setiampolicy/AsyncSetIamPolicy.java | 49 + .../setiampolicy/SyncSetIamPolicy.java | 46 + .../AsyncTestIamPermissions.java | 49 + .../SyncTestIamPermissions.java | 45 + .../updatefunction/AsyncUpdateFunction.java | 49 + .../AsyncUpdateFunctionLRO.java | 49 + .../updatefunction/SyncUpdateFunction.java | 44 + .../SyncUpdateFunctionFunctionFieldmask.java | 40 + .../getfunction/SyncGetFunction.java | 46 + .../getfunction/SyncGetFunction.java | 46 + versions.txt | 2 + 134 files changed, 58548 insertions(+), 10 deletions(-) create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceSettings.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/gapic_metadata.json create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/package-info.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStub.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStubSettings.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceCallableFactory.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceStub.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceCallableFactory.java create mode 100644 google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockFunctionService.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockFunctionServiceImpl.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicy.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicyImpl.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocations.java create mode 100644 google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocationsImpl.java create mode 100644 grpc-google-cloud-functions-v2/pom.xml create mode 100644 grpc-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionServiceGrpc.java create mode 100644 proto-google-cloud-functions-v2/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-functions-v2/pom.xml create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Environment.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilter.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilterOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionName.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponse.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponseOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponse.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponseOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponse.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponseOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponse.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponseOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/LocationName.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSource.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSourceOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVar.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVarOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolume.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolumeOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Source.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenance.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenanceOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Stage.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StageOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessage.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessageOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSource.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSourceOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequest.java create mode 100644 proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequestOrBuilder.java create mode 100644 proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunctionLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionLocationnameFunctionString.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionStringFunctionString.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunctionLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionFunctionname.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionString.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/SyncGenerateUploadUrl.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/AsyncGetFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionFunctionname.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionString.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctions.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctionsPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctions.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsString.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocations.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocationsPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/SyncListLocations.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/AsyncListRuntimes.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimes.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesString.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunctionLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunctionFunctionFieldmask.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/functionservicesettings/getfunction/SyncGetFunction.java create mode 100644 samples/snippets/generated/com/google/cloud/functions/v2/stub/functionservicestubsettings/getfunction/SyncGetFunction.java diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index f7aa1dab..2820f75a 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -73,6 +73,11 @@ grpc-google-cloud-functions-v2alpha 2.4.3 + + com.google.api.grpc + grpc-google-cloud-functions-v2 + 2.4.3 + com.google.api.grpc proto-google-cloud-functions-v1 @@ -88,6 +93,11 @@ proto-google-cloud-functions-v2alpha 2.4.3 + + com.google.api.grpc + proto-google-cloud-functions-v2 + 2.4.3 + diff --git a/google-cloud-functions/pom.xml b/google-cloud-functions/pom.xml index 16493c10..a7ced942 100644 --- a/google-cloud-functions/pom.xml +++ b/google-cloud-functions/pom.xml @@ -41,10 +41,19 @@ com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-functions-v2 + com.google.api.grpc grpc-google-common-protos + + com.google.api.grpc + grpc-google-cloud-functions-v2 + test + com.google.api.grpc grpc-google-iam-v1 diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java new file mode 100644 index 00000000..5140d636 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java @@ -0,0 +1,1582 @@ +/* + * Copyright 2022 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.v2; + +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.httpjson.longrunning.OperationsClient; +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.v2.stub.FunctionServiceStub; +import com.google.cloud.functions.v2.stub.FunctionServiceStubSettings; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Google Cloud Functions is used to deploy functions that are executed by + * Google in response to various events. Data connected with that event is passed to a function as + * the input data. + * + *

A **function** is a resource which describes a function that should be + * executed and how it is triggered. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+ *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+ *   Function response = functionServiceClient.getFunction(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the FunctionServiceClient 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 FunctionServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceSettings functionServiceSettings =
+ *     FunctionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * FunctionServiceClient functionServiceClient =
+ *     FunctionServiceClient.create(functionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceSettings functionServiceSettings =
+ *     FunctionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FunctionServiceClient functionServiceClient =
+ *     FunctionServiceClient.create(functionServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceSettings functionServiceSettings =
+ *     FunctionServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             FunctionServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * FunctionServiceClient functionServiceClient =
+ *     FunctionServiceClient.create(functionServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class FunctionServiceClient implements BackgroundResource { + private final FunctionServiceSettings settings; + private final FunctionServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of FunctionServiceClient with default settings. */ + public static final FunctionServiceClient create() throws IOException { + return create(FunctionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FunctionServiceClient, 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 FunctionServiceClient create(FunctionServiceSettings settings) + throws IOException { + return new FunctionServiceClient(settings); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(FunctionServiceSettings). + */ + public static final FunctionServiceClient create(FunctionServiceStub stub) { + return new FunctionServiceClient(stub); + } + + /** + * Constructs an instance of FunctionServiceClient, 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 FunctionServiceClient(FunctionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FunctionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected FunctionServiceClient(FunctionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final FunctionServiceSettings getSettings() { + return settings; + } + + public FunctionServiceStub 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. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   Function response = functionServiceClient.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 Function getFunction(FunctionName 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   Function response = functionServiceClient.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 Function 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetFunctionRequest request =
+   *       GetFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   Function response = functionServiceClient.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 Function 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetFunctionRequest request =
+   *       GetFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future = functionServiceClient.getFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Function response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getFunctionCallable() { + return stub.getFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(LocationName parent) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listFunctions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(String parent) { + ListFunctionsRequest request = ListFunctionsRequest.newBuilder().setParent(parent).build(); + return listFunctions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Function element : functionServiceClient.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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.listFunctionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Function 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListFunctionsResponse response =
+   *         functionServiceClient.listFunctionsCallable().call(request);
+   *     for (Function 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. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Function function = Function.newBuilder().build();
+   *   String functionId = "functionId-62789869";
+   *   Function response =
+   *       functionServiceClient.createFunctionAsync(parent, function, functionId).get();
+   * }
+   * }
+ * + * @param parent 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. + * @param functionId The ID to use for the function, which will become the final component of the + * function's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + LocationName parent, Function function, String functionId) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFunction(function) + .setFunctionId(functionId) + .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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Function function = Function.newBuilder().build();
+   *   String functionId = "functionId-62789869";
+   *   Function response =
+   *       functionServiceClient.createFunctionAsync(parent, function, functionId).get();
+   * }
+   * }
+ * + * @param parent 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. + * @param functionId The ID to use for the function, which will become the final component of the + * function's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + String parent, Function function, String functionId) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(parent) + .setFunction(function) + .setFunctionId(functionId) + .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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   Function response = functionServiceClient.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 + */ + 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.createFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Function response = future.get();
+   * }
+   * }
+ */ + 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   Function function = Function.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Function response = functionServiceClient.updateFunctionAsync(function, updateMask).get();
+   * }
+   * }
+ * + * @param function Required. New version of the function. + * @param updateMask The list of fields to be updated. If no field mask is provided, all provided + * fields in the request will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateFunctionAsync( + Function function, FieldMask updateMask) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder().setFunction(function).setUpdateMask(updateMask).build(); + return updateFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Function response = functionServiceClient.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 + */ + public final OperationFuture updateFunctionAsync( + UpdateFunctionRequest request) { + return updateFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.updateFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Function response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateFunctionOperationCallable() { + return stub.updateFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   functionServiceClient.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 + */ + public final OperationFuture deleteFunctionAsync(FunctionName 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   functionServiceClient.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 + */ + 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   functionServiceClient.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 + */ + 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.deleteFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + 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: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.deleteFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteFunctionCallable() { + return stub.deleteFunctionCallable(); + } + + // 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. + *
  • 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` + *
+ * + *

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

    + *
  • `Authorization: Bearer YOUR_TOKEN` + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateUploadUrlRequest request =
+   *       GenerateUploadUrlRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   GenerateUploadUrlResponse response = functionServiceClient.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. + *
  • 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` + *
+ * + *

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

    + *
  • `Authorization: Bearer YOUR_TOKEN` + *
+ * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateUploadUrlRequest request =
+   *       GenerateUploadUrlRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.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 30 minutes of generation. For more information about + * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateDownloadUrlRequest request =
+   *       GenerateDownloadUrlRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   GenerateDownloadUrlResponse response = functionServiceClient.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 30 minutes of generation. For more information about + * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateDownloadUrlRequest request =
+   *       GenerateDownloadUrlRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.generateDownloadUrlCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateDownloadUrlResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateDownloadUrlCallable() { + return stub.generateDownloadUrlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of runtimes that are supported for the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListRuntimesResponse response = functionServiceClient.listRuntimes(parent);
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the runtimes should be listed, + * specified in the format `projects/*/locations/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRuntimesResponse listRuntimes(LocationName parent) { + ListRuntimesRequest request = + ListRuntimesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listRuntimes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of runtimes that are supported for the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   ListRuntimesResponse response = functionServiceClient.listRuntimes(parent);
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the runtimes should be listed, + * specified in the format `projects/*/locations/*` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRuntimesResponse listRuntimes(String parent) { + ListRuntimesRequest request = ListRuntimesRequest.newBuilder().setParent(parent).build(); + return listRuntimes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of runtimes that are supported for the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListRuntimesRequest request =
+   *       ListRuntimesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ListRuntimesResponse response = functionServiceClient.listRuntimes(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 ListRuntimesResponse listRuntimes(ListRuntimesRequest request) { + return listRuntimesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of runtimes that are supported for the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListRuntimesRequest request =
+   *       ListRuntimesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.listRuntimesCallable().futureCall(request);
+   *   // Do something.
+   *   ListRuntimesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable listRuntimesCallable() { + return stub.listRuntimesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : functionServiceClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         functionServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = functionServiceClient.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 access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = functionServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = functionServiceClient.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 access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = functionServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = functionServiceClient.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. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.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, + Function, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFunctionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListFunctionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListFunctionsPagedResponse(ListFunctionsPage page) { + super(page, ListFunctionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFunctionsPage + extends AbstractPage< + ListFunctionsRequest, ListFunctionsResponse, Function, 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, + Function, + 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); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceSettings.java new file mode 100644 index 00000000..af930bf9 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceSettings.java @@ -0,0 +1,376 @@ +/* + * Copyright 2022 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.v2; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +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.httpjson.InstantiatingHttpJsonChannelProvider; +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.v2.stub.FunctionServiceStubSettings; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +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 FunctionServiceClient}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceSettings.Builder functionServiceSettingsBuilder =
+ *     FunctionServiceSettings.newBuilder();
+ * functionServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         functionServiceSettingsBuilder
+ *             .getFunctionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FunctionServiceSettings functionServiceSettings = functionServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class FunctionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).getFunctionSettings(); + } + + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listFunctionsSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).createFunctionSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public OperationCallSettings + createFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).createFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).updateFunctionSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public OperationCallSettings + updateFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).updateFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).deleteFunctionSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public OperationCallSettings + deleteFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).deleteFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).generateUploadUrlSettings(); + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).generateDownloadUrlSettings(); + } + + /** Returns the object with the settings used for calls to listRuntimes. */ + public UnaryCallSettings listRuntimesSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listRuntimesSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((FunctionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((FunctionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final FunctionServiceSettings create(FunctionServiceStubSettings stub) + throws IOException { + return new FunctionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FunctionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FunctionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FunctionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FunctionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FunctionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return FunctionServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FunctionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FunctionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 FunctionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FunctionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(FunctionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(FunctionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FunctionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(FunctionServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(FunctionServiceStubSettings.newHttpJsonBuilder()); + } + + public FunctionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((FunctionServiceStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** 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 listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return getStubSettingsBuilder().listFunctionsSettings(); + } + + /** 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. */ + 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. */ + 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. */ + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return getStubSettingsBuilder().deleteFunctionOperationSettings(); + } + + /** 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 listRuntimes. */ + public UnaryCallSettings.Builder + listRuntimesSettings() { + return getStubSettingsBuilder().listRuntimesSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** 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 FunctionServiceSettings build() throws IOException { + return new FunctionServiceSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/gapic_metadata.json b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/gapic_metadata.json new file mode 100644 index 00000000..97bf66fa --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/gapic_metadata.json @@ -0,0 +1,54 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.functions.v2", + "libraryPackage": "com.google.cloud.functions.v2", + "services": { + "FunctionService": { + "clients": { + "grpc": { + "libraryClient": "FunctionServiceClient", + "rpcs": { + "CreateFunction": { + "methods": ["createFunctionAsync", "createFunctionAsync", "createFunctionAsync", "createFunctionOperationCallable", "createFunctionCallable"] + }, + "DeleteFunction": { + "methods": ["deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionOperationCallable", "deleteFunctionCallable"] + }, + "GenerateDownloadUrl": { + "methods": ["generateDownloadUrl", "generateDownloadUrlCallable"] + }, + "GenerateUploadUrl": { + "methods": ["generateUploadUrl", "generateUploadUrlCallable"] + }, + "GetFunction": { + "methods": ["getFunction", "getFunction", "getFunction", "getFunctionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "ListFunctions": { + "methods": ["listFunctions", "listFunctions", "listFunctions", "listFunctionsPagedCallable", "listFunctionsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRuntimes": { + "methods": ["listRuntimes", "listRuntimes", "listRuntimes", "listRuntimesCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateFunction": { + "methods": ["updateFunctionAsync", "updateFunctionAsync", "updateFunctionOperationCallable", "updateFunctionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/package-info.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/package-info.java new file mode 100644 index 00000000..5fa55e94 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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. + * + *

======================= FunctionServiceClient ======================= + * + *

Service Description: Google Cloud Functions is used to deploy functions that are executed by + * Google in response to various events. Data connected with that event is passed to a function as + * the input data. + * + *

A **function** is a resource which describes a function that should be + * executed and how it is triggered. + * + *

Sample for FunctionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+ *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+ *   Function response = functionServiceClient.getFunction(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.functions.v2; + +import javax.annotation.Generated; diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStub.java new file mode 100644 index 00000000..f29a7aa8 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStub.java @@ -0,0 +1,146 @@ +/* + * Copyright 2022 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.v2.stub; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +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.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2.GetFunctionRequest; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.ListFunctionsResponse; +import com.google.cloud.functions.v2.ListRuntimesRequest; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.OperationMetadata; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +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 the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class FunctionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable getFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: getFunctionCallable()"); + } + + public UnaryCallable + listFunctionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsPagedCallable()"); + } + + public UnaryCallable listFunctionsCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsCallable()"); + } + + public OperationCallable + createFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionOperationCallable()"); + } + + public UnaryCallable createFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionCallable()"); + } + + public OperationCallable + updateFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionOperationCallable()"); + } + + public UnaryCallable updateFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionCallable()"); + } + + public OperationCallable + deleteFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionOperationCallable()"); + } + + public UnaryCallable deleteFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionCallable()"); + } + + public UnaryCallable + generateUploadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateUploadUrlCallable()"); + } + + public UnaryCallable + generateDownloadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateDownloadUrlCallable()"); + } + + public UnaryCallable listRuntimesCallable() { + throw new UnsupportedOperationException("Not implemented: listRuntimesCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + 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/v2/stub/FunctionServiceStubSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStubSettings.java new file mode 100644 index 00000000..14d9b30d --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/FunctionServiceStubSettings.java @@ -0,0 +1,864 @@ +/* + * Copyright 2022 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.v2.stub; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +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.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2.GetFunctionRequest; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.ListFunctionsResponse; +import com.google.cloud.functions.v2.ListRuntimesRequest; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.OperationMetadata; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +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 FunctionServiceStub}. + * + *

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceStubSettings.Builder functionServiceSettingsBuilder =
+ *     FunctionServiceStubSettings.newBuilder();
+ * functionServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         functionServiceSettingsBuilder
+ *             .getFunctionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FunctionServiceStubSettings functionServiceSettings = functionServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class FunctionServiceStubSettings 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 UnaryCallSettings getFunctionSettings; + private final PagedCallSettings< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + 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 + generateUploadUrlSettings; + private final UnaryCallSettings + generateDownloadUrlSettings; + private final UnaryCallSettings listRuntimesSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + 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 + ? ImmutableList.of() + : payload.getFunctionsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + 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); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** 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 listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** 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. */ + 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. */ + 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. */ + public OperationCallSettings + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** 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 listRuntimes. */ + public UnaryCallSettings listRuntimesSettings() { + return listRuntimesSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** 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; + } + + public FunctionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFunctionServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonFunctionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", 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 mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudfunctions.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + 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 defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FunctionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FunctionServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FunctionServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** 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 FunctionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getFunctionSettings = settingsBuilder.getFunctionSettings().build(); + listFunctionsSettings = settingsBuilder.listFunctionsSettings().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(); + generateUploadUrlSettings = settingsBuilder.generateUploadUrlSettings().build(); + generateDownloadUrlSettings = settingsBuilder.generateDownloadUrlSettings().build(); + listRuntimesSettings = settingsBuilder.listRuntimesSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for FunctionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getFunctionSettings; + private final PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings.Builder + createFunctionSettings; + private final OperationCallSettings.Builder + createFunctionOperationSettings; + private final UnaryCallSettings.Builder + updateFunctionSettings; + private final OperationCallSettings.Builder + updateFunctionOperationSettings; + private final UnaryCallSettings.Builder + deleteFunctionSettings; + private final OperationCallSettings.Builder + deleteFunctionOperationSettings; + private final UnaryCallSettings.Builder + generateUploadUrlSettings; + private final UnaryCallSettings.Builder + generateDownloadUrlSettings; + private final UnaryCallSettings.Builder + listRuntimesSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + 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("no_retry_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().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listFunctionsSettings = PagedCallSettings.newBuilder(LIST_FUNCTIONS_PAGE_STR_FACT); + createFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createFunctionOperationSettings = OperationCallSettings.newBuilder(); + updateFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateFunctionOperationSettings = OperationCallSettings.newBuilder(); + deleteFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteFunctionOperationSettings = OperationCallSettings.newBuilder(); + generateUploadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateDownloadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRuntimesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFunctionSettings, + listFunctionsSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + listRuntimesSettings, + listLocationsSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(FunctionServiceStubSettings settings) { + super(settings); + + getFunctionSettings = settings.getFunctionSettings.toBuilder(); + listFunctionsSettings = settings.listFunctionsSettings.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(); + generateUploadUrlSettings = settings.generateUploadUrlSettings.toBuilder(); + generateDownloadUrlSettings = settings.generateDownloadUrlSettings.toBuilder(); + listRuntimesSettings = settings.listRuntimesSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFunctionSettings, + listFunctionsSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + listRuntimesSettings, + listLocationsSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listFunctionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_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 + .listRuntimesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .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_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Function.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Function.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** 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 listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** 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 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 listRuntimes. */ + public UnaryCallSettings.Builder + listRuntimesSettings() { + return listRuntimesSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** 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 FunctionServiceStubSettings build() throws IOException { + return new FunctionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceCallableFactory.java new file mode 100644 index 00000000..e575ade6 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2022 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.v2.stub; + +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.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the FunctionService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcFunctionServiceCallableFactory 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 callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceStub.java new file mode 100644 index 00000000..c152a91c --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/GrpcFunctionServiceStub.java @@ -0,0 +1,584 @@ +/* + * Copyright 2022 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.v2.stub; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.functions.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2.GetFunctionRequest; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.ListFunctionsResponse; +import com.google.cloud.functions.v2.ListRuntimesRequest; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.OperationMetadata; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +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.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcFunctionServiceStub extends FunctionServiceStub { + private static final MethodDescriptor getFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2.FunctionService/GetFunction") + .setRequestMarshaller(ProtoUtils.marshaller(GetFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Function.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listFunctionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2.FunctionService/ListFunctions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListFunctionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFunctionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2.FunctionService/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.v2.FunctionService/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.v2.FunctionService/DeleteFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + generateUploadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2.FunctionService/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.v2.FunctionService/GenerateDownloadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRuntimesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2.FunctionService/ListRuntimes") + .setRequestMarshaller(ProtoUtils.marshaller(ListRuntimesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRuntimesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/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.iam.v1.IAMPolicy/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.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getFunctionCallable; + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + 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 + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable listRuntimesCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFunctionServiceStub create(FunctionServiceStubSettings settings) + throws IOException { + return new GrpcFunctionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFunctionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcFunctionServiceStub( + FunctionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFunctionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFunctionServiceStub( + FunctionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFunctionServiceStub, 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 GrpcFunctionServiceStub( + FunctionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcFunctionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcFunctionServiceStub, 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 GrpcFunctionServiceStub( + FunctionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listFunctionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings createFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setParamsExtractor( + 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( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateUploadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateDownloadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listRuntimesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRuntimesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + operationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + operationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + operationsStub); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.listRuntimesCallable = + callableFactory.createUnaryCallable( + listRuntimesTransportSettings, settings.listRuntimesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), 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); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable listRuntimesCallable() { + return listRuntimesCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceCallableFactory.java new file mode 100644 index 00000000..c2ddf23e --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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.v2.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +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.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the FunctionService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonFunctionServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java new file mode 100644 index 00000000..f96e4318 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java @@ -0,0 +1,875 @@ +/* + * Copyright 2022 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.v2.stub; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2.GetFunctionRequest; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.ListFunctionsResponse; +import com.google.cloud.functions.v2.ListRuntimesRequest; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.OperationMetadata; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +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 com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonFunctionServiceStub extends FunctionServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Function.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + getFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/GetFunction") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Function.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listFunctionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/ListFunctions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFunctionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/CreateFunction") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "functionId", request.getFunctionId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/UpdateFunction") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{function.name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "function.name", request.getFunction().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/DeleteFunction") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + generateUploadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/GenerateUploadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/functions:generateUploadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateUploadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + generateDownloadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/GenerateDownloadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*/locations/*/functions/*}:generateDownloadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateDownloadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRuntimesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2.FunctionService/ListRuntimes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{parent=projects/*/locations/*}/runtimes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRuntimesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{resource=projects/*/locations/*/functions/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{resource=projects/*/locations/*/functions/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2/{resource=projects/*/locations/*/functions/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getFunctionCallable; + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + 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 + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable listRuntimesCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonFunctionServiceStub create(FunctionServiceStubSettings settings) + throws IOException { + return new HttpJsonFunctionServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonFunctionServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonFunctionServiceStub( + FunctionServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonFunctionServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonFunctionServiceStub( + FunctionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonFunctionServiceStub, 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 HttpJsonFunctionServiceStub( + FunctionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonFunctionServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonFunctionServiceStub, 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 HttpJsonFunctionServiceStub( + FunctionServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings getFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listFunctionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateUploadUrlTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateDownloadUrlTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listRuntimesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRuntimesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.listRuntimesCallable = + callableFactory.createUnaryCallable( + listRuntimesTransportSettings, settings.listRuntimesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), 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); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getFunctionMethodDescriptor); + methodDescriptors.add(listFunctionsMethodDescriptor); + methodDescriptors.add(createFunctionMethodDescriptor); + methodDescriptors.add(updateFunctionMethodDescriptor); + methodDescriptors.add(deleteFunctionMethodDescriptor); + methodDescriptors.add(generateUploadUrlMethodDescriptor); + methodDescriptors.add(generateDownloadUrlMethodDescriptor); + methodDescriptors.add(listRuntimesMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable listRuntimesCallable() { + return listRuntimesCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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/v2/FunctionServiceClientHttpJsonTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java new file mode 100644 index 00000000..ecee9e1f --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java @@ -0,0 +1,1006 @@ +/* + * Copyright 2022 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.v2; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.functions.v2.stub.HttpJsonFunctionServiceStub; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +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.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FunctionServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static FunctionServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonFunctionServiceStub.getMethodDescriptors(), + FunctionServiceSettings.getDefaultEndpoint()); + FunctionServiceSettings settings = + FunctionServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + FunctionServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FunctionServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest2() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Function function = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Function actualResponse = client.updateFunctionAsync(function, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Function function = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFunctionAsync(function, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder() + .setUploadUrl("uploadUrl1239085998") + .setStorageSource(StorageSource.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest2() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .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/v2/FunctionServiceClientTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java new file mode 100644 index 00000000..b16a30f9 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java @@ -0,0 +1,918 @@ +/* + * Copyright 2022 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.v2; + +import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; + +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.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +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 com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FunctionServiceClientTest { + private static MockFunctionService mockFunctionService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private FunctionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockFunctionService = new MockFunctionService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockFunctionService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + FunctionServiceSettings settings = + FunctionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FunctionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = ((GetFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String name = "name3373707"; + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = ((GetFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String name = "name3373707"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockFunctionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = ((ListFunctionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest2() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = ((ListFunctionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFunctionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = ((CreateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(functionId, actualRequest.getFunctionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = ((CreateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(functionId, actualRequest.getFunctionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Function actualResponse = client.updateFunctionAsync(function, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFunctionRequest actualRequest = ((UpdateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFunctionAsync(function, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = ((DeleteFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + FunctionName name = FunctionName.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 + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = ((DeleteFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String name = "name3373707"; + 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 + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder() + .setUploadUrl("uploadUrl1239085998") + .setStorageSource(StorageSource.newBuilder().build()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateUploadUrlRequest actualRequest = ((GenerateUploadUrlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockFunctionService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateDownloadUrlRequest actualRequest = ((GenerateDownloadUrlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimesRequest actualRequest = ((ListRuntimesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest2() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimesRequest actualRequest = ((ListRuntimesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .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/v2/MockFunctionService.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockFunctionService.java new file mode 100644 index 00000000..1819bb65 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockFunctionService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.v2; + +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; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFunctionService implements MockGrpcService { + private final MockFunctionServiceImpl serviceImpl; + + public MockFunctionService() { + serviceImpl = new MockFunctionServiceImpl(); + } + + @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/v2/MockFunctionServiceImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockFunctionServiceImpl.java new file mode 100644 index 00000000..2baf20d1 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockFunctionServiceImpl.java @@ -0,0 +1,230 @@ +/* + * Copyright 2022 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.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.functions.v2.FunctionServiceGrpc.FunctionServiceImplBase; +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; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFunctionServiceImpl extends FunctionServiceImplBase { + private List requests; + private Queue responses; + + public MockFunctionServiceImpl() { + 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 getFunction(GetFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Function) { + requests.add(request); + responseObserver.onNext(((Function) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Function.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listFunctions( + ListFunctionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method ListFunctions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListFunctionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createFunction( + CreateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method CreateFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateFunction( + UpdateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method UpdateFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteFunction( + DeleteFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method DeleteFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateUploadUrl( + GenerateUploadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method GenerateUploadUrl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateUploadUrlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateDownloadUrl( + GenerateDownloadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method GenerateDownloadUrl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateDownloadUrlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRuntimes( + ListRuntimesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRuntimesResponse) { + requests.add(request); + responseObserver.onNext(((ListRuntimesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRuntimes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRuntimesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicy.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicy.java new file mode 100644 index 00000000..117aa5d3 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.v2; + +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; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @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/v2/MockIAMPolicyImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicyImpl.java new file mode 100644 index 00000000..61650cd9 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 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.v2; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +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.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + 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 testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + 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( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocations.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocations.java new file mode 100644 index 00000000..01eafbeb --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.v2; + +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; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @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/v2/MockLocationsImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocationsImpl.java new file mode 100644 index 00000000..9fa73b67 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/MockLocationsImpl.java @@ -0,0 +1,83 @@ +/* + * Copyright 2022 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.v2; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +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; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + 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 listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-functions-v2/pom.xml b/grpc-google-cloud-functions-v2/pom.xml new file mode 100644 index 00000000..ca917083 --- /dev/null +++ b/grpc-google-cloud-functions-v2/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-functions-v2 + 2.4.3 + grpc-google-cloud-functions-v2 + GRPC library for google-cloud-functions + + com.google.cloud + google-cloud-functions-parent + 2.4.3 + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-functions-v2 + + + 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-v2/src/main/java/com/google/cloud/functions/v2/FunctionServiceGrpc.java b/grpc-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionServiceGrpc.java new file mode 100644 index 00000000..d9a054b7 --- /dev/null +++ b/grpc-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionServiceGrpc.java @@ -0,0 +1,1296 @@ +/* + * 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.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Google Cloud Functions is used to deploy functions that are executed by
+ * Google in response to various events. Data connected with that event is
+ * passed to a function as the input data.
+ * A **function** is a resource which describes a function that should be
+ * executed and how it is triggered.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/functions/v2/functions.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class FunctionServiceGrpc { + + private FunctionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.functions.v2.FunctionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GetFunctionRequest, com.google.cloud.functions.v2.Function> + getGetFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFunction", + requestType = com.google.cloud.functions.v2.GetFunctionRequest.class, + responseType = com.google.cloud.functions.v2.Function.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GetFunctionRequest, com.google.cloud.functions.v2.Function> + getGetFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GetFunctionRequest, + com.google.cloud.functions.v2.Function> + getGetFunctionMethod; + if ((getGetFunctionMethod = FunctionServiceGrpc.getGetFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGetFunctionMethod = FunctionServiceGrpc.getGetFunctionMethod) == null) { + FunctionServiceGrpc.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.v2.GetFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2.Function.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GetFunction")) + .build(); + } + } + } + return getGetFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.ListFunctionsRequest, + com.google.cloud.functions.v2.ListFunctionsResponse> + getListFunctionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFunctions", + requestType = com.google.cloud.functions.v2.ListFunctionsRequest.class, + responseType = com.google.cloud.functions.v2.ListFunctionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.ListFunctionsRequest, + com.google.cloud.functions.v2.ListFunctionsResponse> + getListFunctionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.ListFunctionsRequest, + com.google.cloud.functions.v2.ListFunctionsResponse> + getListFunctionsMethod; + if ((getListFunctionsMethod = FunctionServiceGrpc.getListFunctionsMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getListFunctionsMethod = FunctionServiceGrpc.getListFunctionsMethod) == null) { + FunctionServiceGrpc.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.v2.ListFunctionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2.ListFunctionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("ListFunctions")) + .build(); + } + } + } + return getListFunctionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFunction", + requestType = com.google.cloud.functions.v2.CreateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod; + if ((getCreateFunctionMethod = FunctionServiceGrpc.getCreateFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getCreateFunctionMethod = FunctionServiceGrpc.getCreateFunctionMethod) == null) { + FunctionServiceGrpc.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.v2.CreateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("CreateFunction")) + .build(); + } + } + } + return getCreateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateFunction", + requestType = com.google.cloud.functions.v2.UpdateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod; + if ((getUpdateFunctionMethod = FunctionServiceGrpc.getUpdateFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getUpdateFunctionMethod = FunctionServiceGrpc.getUpdateFunctionMethod) == null) { + FunctionServiceGrpc.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.v2.UpdateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("UpdateFunction")) + .build(); + } + } + } + return getUpdateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFunction", + requestType = com.google.cloud.functions.v2.DeleteFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod; + if ((getDeleteFunctionMethod = FunctionServiceGrpc.getDeleteFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getDeleteFunctionMethod = FunctionServiceGrpc.getDeleteFunctionMethod) == null) { + FunctionServiceGrpc.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.v2.DeleteFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("DeleteFunction")) + .build(); + } + } + } + return getDeleteFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GenerateUploadUrlRequest, + com.google.cloud.functions.v2.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateUploadUrl", + requestType = com.google.cloud.functions.v2.GenerateUploadUrlRequest.class, + responseType = com.google.cloud.functions.v2.GenerateUploadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GenerateUploadUrlRequest, + com.google.cloud.functions.v2.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GenerateUploadUrlRequest, + com.google.cloud.functions.v2.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + if ((getGenerateUploadUrlMethod = FunctionServiceGrpc.getGenerateUploadUrlMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGenerateUploadUrlMethod = FunctionServiceGrpc.getGenerateUploadUrlMethod) == null) { + FunctionServiceGrpc.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.v2.GenerateUploadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2.GenerateUploadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GenerateUploadUrl")) + .build(); + } + } + } + return getGenerateUploadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateDownloadUrl", + requestType = com.google.cloud.functions.v2.GenerateDownloadUrlRequest.class, + responseType = com.google.cloud.functions.v2.GenerateDownloadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + if ((getGenerateDownloadUrlMethod = FunctionServiceGrpc.getGenerateDownloadUrlMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGenerateDownloadUrlMethod = FunctionServiceGrpc.getGenerateDownloadUrlMethod) + == null) { + FunctionServiceGrpc.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.v2.GenerateDownloadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2.GenerateDownloadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GenerateDownloadUrl")) + .build(); + } + } + } + return getGenerateDownloadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.ListRuntimesRequest, + com.google.cloud.functions.v2.ListRuntimesResponse> + getListRuntimesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuntimes", + requestType = com.google.cloud.functions.v2.ListRuntimesRequest.class, + responseType = com.google.cloud.functions.v2.ListRuntimesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.ListRuntimesRequest, + com.google.cloud.functions.v2.ListRuntimesResponse> + getListRuntimesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2.ListRuntimesRequest, + com.google.cloud.functions.v2.ListRuntimesResponse> + getListRuntimesMethod; + if ((getListRuntimesMethod = FunctionServiceGrpc.getListRuntimesMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getListRuntimesMethod = FunctionServiceGrpc.getListRuntimesMethod) == null) { + FunctionServiceGrpc.getListRuntimesMethod = + getListRuntimesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRuntimes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2.ListRuntimesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2.ListRuntimesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("ListRuntimes")) + .build(); + } + } + } + return getListRuntimesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FunctionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceStub(channel, callOptions); + } + }; + return FunctionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FunctionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceBlockingStub(channel, callOptions); + } + }; + return FunctionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FunctionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceFutureStub(channel, callOptions); + } + }; + return FunctionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public abstract static class FunctionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v2.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v2.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListFunctionsMethod(), 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.v2.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v2.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.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.v2.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteFunctionMethod(), 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.
+     * * 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`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v2.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.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
+     * 30 minutes of 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.v2.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateDownloadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public void listRuntimes( + com.google.cloud.functions.v2.ListRuntimesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRuntimesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.GetFunctionRequest, + com.google.cloud.functions.v2.Function>(this, METHODID_GET_FUNCTION))) + .addMethod( + getListFunctionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.ListFunctionsRequest, + com.google.cloud.functions.v2.ListFunctionsResponse>( + this, METHODID_LIST_FUNCTIONS))) + .addMethod( + getCreateFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.CreateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_FUNCTION))) + .addMethod( + getUpdateFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.UpdateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_FUNCTION))) + .addMethod( + getDeleteFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.DeleteFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_FUNCTION))) + .addMethod( + getGenerateUploadUrlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.GenerateUploadUrlRequest, + com.google.cloud.functions.v2.GenerateUploadUrlResponse>( + this, METHODID_GENERATE_UPLOAD_URL))) + .addMethod( + getGenerateDownloadUrlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2.GenerateDownloadUrlResponse>( + this, METHODID_GENERATE_DOWNLOAD_URL))) + .addMethod( + getListRuntimesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2.ListRuntimesRequest, + com.google.cloud.functions.v2.ListRuntimesResponse>( + this, METHODID_LIST_RUNTIMES))) + .build(); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private FunctionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v2.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v2.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListFunctionsMethod(), 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.v2.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v2.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.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.v2.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), 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.
+     * * 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`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v2.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.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
+     * 30 minutes of 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.v2.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public void listRuntimes( + com.google.cloud.functions.v2.ListRuntimesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRuntimesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private FunctionServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2.Function getFunction( + com.google.cloud.functions.v2.GetFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2.ListFunctionsResponse listFunctions( + com.google.cloud.functions.v2.ListFunctionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListFunctionsMethod(), 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.v2.CreateFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.longrunning.Operation updateFunction( + com.google.cloud.functions.v2.UpdateFunctionRequest request) { + return io.grpc.stub.ClientCalls.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.v2.DeleteFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteFunctionMethod(), 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.
+     * * 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`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.cloud.functions.v2.GenerateUploadUrlResponse generateUploadUrl( + com.google.cloud.functions.v2.GenerateUploadUrlRequest request) { + return io.grpc.stub.ClientCalls.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
+     * 30 minutes of 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.v2.GenerateDownloadUrlResponse generateDownloadUrl( + com.google.cloud.functions.v2.GenerateDownloadUrlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateDownloadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2.ListRuntimesResponse listRuntimes( + com.google.cloud.functions.v2.ListRuntimesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuntimesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private FunctionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2.Function> + getFunction(com.google.cloud.functions.v2.GetFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2.ListFunctionsResponse> + listFunctions(com.google.cloud.functions.v2.ListFunctionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListFunctionsMethod(), 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.v2.CreateFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateFunction(com.google.cloud.functions.v2.UpdateFunctionRequest request) { + return io.grpc.stub.ClientCalls.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.v2.DeleteFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), 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.
+     * * 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`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2.GenerateUploadUrlResponse> + generateUploadUrl(com.google.cloud.functions.v2.GenerateUploadUrlRequest request) { + return io.grpc.stub.ClientCalls.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
+     * 30 minutes of 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.v2.GenerateDownloadUrlResponse> + generateDownloadUrl(com.google.cloud.functions.v2.GenerateDownloadUrlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2.ListRuntimesResponse> + listRuntimes(com.google.cloud.functions.v2.ListRuntimesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuntimesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_FUNCTION = 0; + private static final int METHODID_LIST_FUNCTIONS = 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_GENERATE_UPLOAD_URL = 5; + private static final int METHODID_GENERATE_DOWNLOAD_URL = 6; + private static final int METHODID_LIST_RUNTIMES = 7; + + 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 FunctionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FunctionServiceImplBase 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_GET_FUNCTION: + serviceImpl.getFunction( + (com.google.cloud.functions.v2.GetFunctionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_FUNCTIONS: + serviceImpl.listFunctions( + (com.google.cloud.functions.v2.ListFunctionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_FUNCTION: + serviceImpl.createFunction( + (com.google.cloud.functions.v2.CreateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_FUNCTION: + serviceImpl.updateFunction( + (com.google.cloud.functions.v2.UpdateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_FUNCTION: + serviceImpl.deleteFunction( + (com.google.cloud.functions.v2.DeleteFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_UPLOAD_URL: + serviceImpl.generateUploadUrl( + (com.google.cloud.functions.v2.GenerateUploadUrlRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GENERATE_DOWNLOAD_URL: + serviceImpl.generateDownloadUrl( + (com.google.cloud.functions.v2.GenerateDownloadUrlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v2.GenerateDownloadUrlResponse>) + responseObserver); + break; + case METHODID_LIST_RUNTIMES: + serviceImpl.listRuntimes( + (com.google.cloud.functions.v2.ListRuntimesRequest) 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 FunctionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FunctionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("FunctionService"); + } + } + + private static final class FunctionServiceFileDescriptorSupplier + extends FunctionServiceBaseDescriptorSupplier { + FunctionServiceFileDescriptorSupplier() {} + } + + private static final class FunctionServiceMethodDescriptorSupplier + extends FunctionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FunctionServiceMethodDescriptorSupplier(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 (FunctionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FunctionServiceFileDescriptorSupplier()) + .addMethod(getGetFunctionMethod()) + .addMethod(getListFunctionsMethod()) + .addMethod(getCreateFunctionMethod()) + .addMethod(getUpdateFunctionMethod()) + .addMethod(getDeleteFunctionMethod()) + .addMethod(getGenerateUploadUrlMethod()) + .addMethod(getGenerateDownloadUrlMethod()) + .addMethod(getListRuntimesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 1befb4e0..abd8aca4 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,16 @@ google-cloud-functions 2.4.3 + + com.google.api.grpc + proto-google-cloud-functions-v2 + 2.4.3 + + + com.google.api.grpc + grpc-google-cloud-functions-v2 + 2.4.3 + com.google.api.grpc proto-google-cloud-functions-v2alpha @@ -133,9 +143,11 @@ grpc-google-cloud-functions-v1 grpc-google-cloud-functions-v2beta grpc-google-cloud-functions-v2alpha + grpc-google-cloud-functions-v2 proto-google-cloud-functions-v1 proto-google-cloud-functions-v2beta proto-google-cloud-functions-v2alpha + proto-google-cloud-functions-v2 google-cloud-functions-bom diff --git a/proto-google-cloud-functions-v2/clirr-ignored-differences.xml b/proto-google-cloud-functions-v2/clirr-ignored-differences.xml new file mode 100644 index 00000000..af1ad939 --- /dev/null +++ b/proto-google-cloud-functions-v2/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/functions/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/functions/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/functions/v2/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-functions-v2/pom.xml b/proto-google-cloud-functions-v2/pom.xml new file mode 100644 index 00000000..b2f5505e --- /dev/null +++ b/proto-google-cloud-functions-v2/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-functions-v2 + 2.4.3 + proto-google-cloud-functions-v2 + Proto library for google-cloud-functions + + com.google.cloud + google-cloud-functions-parent + 2.4.3 + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java new file mode 100644 index 00000000..3aafdfe0 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java @@ -0,0 +1,2508 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Describes the Build step of the function that builds a container from the
+ * given source.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.BuildConfig} + */ +public final class BuildConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.BuildConfig) + BuildConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BuildConfig.newBuilder() to construct. + private BuildConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BuildConfig() { + build_ = ""; + runtime_ = ""; + entryPoint_ = ""; + workerPool_ = ""; + dockerRepository_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BuildConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BuildConfig( + 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(); + + build_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + runtime_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entryPoint_ = s; + break; + } + case 34: + { + com.google.cloud.functions.v2.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + workerPool_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + dockerRepository_ = s; + break; + } + case 66: + { + com.google.cloud.functions.v2.SourceProvenance.Builder subBuilder = null; + if (sourceProvenance_ != null) { + subBuilder = sourceProvenance_.toBuilder(); + } + sourceProvenance_ = + input.readMessage( + com.google.cloud.functions.v2.SourceProvenance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceProvenance_); + sourceProvenance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_BuildConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + 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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_BuildConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.BuildConfig.class, + com.google.cloud.functions.v2.BuildConfig.Builder.class); + } + + public static final int BUILD_FIELD_NUMBER = 1; + private volatile java.lang.Object build_; + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + @java.lang.Override + public java.lang.String getBuild() { + java.lang.Object ref = build_; + 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(); + build_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildBytes() { + java.lang.Object ref = build_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + build_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUNTIME_FIELD_NUMBER = 2; + 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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @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 ENTRY_POINT_FIELD_NUMBER = 3; + 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 = 3; + * + * @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 = 3; + * + * @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 SOURCE_FIELD_NUMBER = 4; + private com.google.cloud.functions.v2.Source source_; + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2.Source source = 4; + * + * @return Whether the source field is set. + */ + @java.lang.Override + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2.Source source = 4; + * + * @return The source. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Source getSource() { + return source_ == null ? com.google.cloud.functions.v2.Source.getDefaultInstance() : source_; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + public static final int SOURCE_PROVENANCE_FIELD_NUMBER = 8; + private com.google.cloud.functions.v2.SourceProvenance sourceProvenance_; + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + @java.lang.Override + public boolean hasSourceProvenance() { + return sourceProvenance_ != null; + } + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + @java.lang.Override + public com.google.cloud.functions.v2.SourceProvenance getSourceProvenance() { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.SourceProvenanceOrBuilder getSourceProvenanceOrBuilder() { + return getSourceProvenance(); + } + + public static final int WORKER_POOL_FIELD_NUMBER = 5; + private volatile java.lang.Object workerPool_; + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + @java.lang.Override + public java.lang.String getWorkerPool() { + java.lang.Object ref = workerPool_; + 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(); + workerPool_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkerPoolBytes() { + java.lang.Object ref = workerPool_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 6; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_BuildConfig_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(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DOCKER_REPOSITORY_FIELD_NUMBER = 7; + private volatile java.lang.Object dockerRepository_; + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + @java.lang.Override + public java.lang.String getDockerRepository() { + java.lang.Object ref = dockerRepository_; + 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(); + dockerRepository_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDockerRepositoryBytes() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerRepository_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(build_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, build_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtime_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, runtime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entryPoint_); + } + if (source_ != null) { + output.writeMessage(4, getSource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, workerPool_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 6); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, dockerRepository_); + } + if (sourceProvenance_ != null) { + output.writeMessage(8, getSourceProvenance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(build_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, build_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtime_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, runtime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entryPoint_); + } + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, workerPool_); + } + 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(6, environmentVariables__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, dockerRepository_); + } + if (sourceProvenance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSourceProvenance()); + } + 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.v2.BuildConfig)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.BuildConfig other = + (com.google.cloud.functions.v2.BuildConfig) obj; + + if (!getBuild().equals(other.getBuild())) return false; + if (!getRuntime().equals(other.getRuntime())) return false; + if (!getEntryPoint().equals(other.getEntryPoint())) return false; + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (!getSource().equals(other.getSource())) return false; + } + if (hasSourceProvenance() != other.hasSourceProvenance()) return false; + if (hasSourceProvenance()) { + if (!getSourceProvenance().equals(other.getSourceProvenance())) return false; + } + if (!getWorkerPool().equals(other.getWorkerPool())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (!getDockerRepository().equals(other.getDockerRepository())) 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) + BUILD_FIELD_NUMBER; + hash = (53 * hash) + getBuild().hashCode(); + hash = (37 * hash) + RUNTIME_FIELD_NUMBER; + hash = (53 * hash) + getRuntime().hashCode(); + hash = (37 * hash) + ENTRY_POINT_FIELD_NUMBER; + hash = (53 * hash) + getEntryPoint().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + if (hasSourceProvenance()) { + hash = (37 * hash) + SOURCE_PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceProvenance().hashCode(); + } + hash = (37 * hash) + WORKER_POOL_FIELD_NUMBER; + hash = (53 * hash) + getWorkerPool().hashCode(); + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + DOCKER_REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getDockerRepository().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.BuildConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.BuildConfig 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.v2.BuildConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.BuildConfig 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.v2.BuildConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.BuildConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.BuildConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.BuildConfig 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.v2.BuildConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.BuildConfig 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.v2.BuildConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.BuildConfig 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.v2.BuildConfig 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 Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.BuildConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.BuildConfig) + com.google.cloud.functions.v2.BuildConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_BuildConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + 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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_BuildConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.BuildConfig.class, + com.google.cloud.functions.v2.BuildConfig.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.BuildConfig.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(); + build_ = ""; + + runtime_ = ""; + + entryPoint_ = ""; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + workerPool_ = ""; + + internalGetMutableEnvironmentVariables().clear(); + dockerRepository_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_BuildConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfig getDefaultInstanceForType() { + return com.google.cloud.functions.v2.BuildConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfig build() { + com.google.cloud.functions.v2.BuildConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfig buildPartial() { + com.google.cloud.functions.v2.BuildConfig result = + new com.google.cloud.functions.v2.BuildConfig(this); + int from_bitField0_ = bitField0_; + result.build_ = build_; + result.runtime_ = runtime_; + result.entryPoint_ = entryPoint_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + if (sourceProvenanceBuilder_ == null) { + result.sourceProvenance_ = sourceProvenance_; + } else { + result.sourceProvenance_ = sourceProvenanceBuilder_.build(); + } + result.workerPool_ = workerPool_; + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.dockerRepository_ = dockerRepository_; + 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.v2.BuildConfig) { + return mergeFrom((com.google.cloud.functions.v2.BuildConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.BuildConfig other) { + if (other == com.google.cloud.functions.v2.BuildConfig.getDefaultInstance()) return this; + if (!other.getBuild().isEmpty()) { + build_ = other.build_; + onChanged(); + } + if (!other.getRuntime().isEmpty()) { + runtime_ = other.runtime_; + onChanged(); + } + if (!other.getEntryPoint().isEmpty()) { + entryPoint_ = other.entryPoint_; + onChanged(); + } + if (other.hasSource()) { + mergeSource(other.getSource()); + } + if (other.hasSourceProvenance()) { + mergeSourceProvenance(other.getSourceProvenance()); + } + if (!other.getWorkerPool().isEmpty()) { + workerPool_ = other.workerPool_; + onChanged(); + } + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (!other.getDockerRepository().isEmpty()) { + dockerRepository_ = other.dockerRepository_; + 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.v2.BuildConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.BuildConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object build_ = ""; + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + public java.lang.String getBuild() { + java.lang.Object ref = build_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + build_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + public com.google.protobuf.ByteString getBuildBytes() { + java.lang.Object ref = build_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + build_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The build to set. + * @return This builder for chaining. + */ + public Builder setBuild(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + build_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBuild() { + + build_ = getDefaultInstance().getBuild(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for build to set. + * @return This builder for chaining. + */ + public Builder setBuildBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + build_ = 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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @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 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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 = 3; + * + * @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 com.google.cloud.functions.v2.Source source_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Source, + com.google.cloud.functions.v2.Source.Builder, + com.google.cloud.functions.v2.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + * + * @return The source. + */ + public com.google.cloud.functions.v2.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.functions.v2.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + public Builder setSource(com.google.cloud.functions.v2.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + public Builder setSource(com.google.cloud.functions.v2.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + public Builder mergeSource(com.google.cloud.functions.v2.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.functions.v2.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + public com.google.cloud.functions.v2.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + public com.google.cloud.functions.v2.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.functions.v2.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Source, + com.google.cloud.functions.v2.Source.Builder, + com.google.cloud.functions.v2.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Source, + com.google.cloud.functions.v2.Source.Builder, + com.google.cloud.functions.v2.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + private com.google.cloud.functions.v2.SourceProvenance sourceProvenance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.SourceProvenance, + com.google.cloud.functions.v2.SourceProvenance.Builder, + com.google.cloud.functions.v2.SourceProvenanceOrBuilder> + sourceProvenanceBuilder_; + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + public boolean hasSourceProvenance() { + return sourceProvenanceBuilder_ != null || sourceProvenance_ != null; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + public com.google.cloud.functions.v2.SourceProvenance getSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } else { + return sourceProvenanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceProvenance(com.google.cloud.functions.v2.SourceProvenance value) { + if (sourceProvenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceProvenance_ = value; + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceProvenance( + com.google.cloud.functions.v2.SourceProvenance.Builder builderForValue) { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = builderForValue.build(); + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSourceProvenance(com.google.cloud.functions.v2.SourceProvenance value) { + if (sourceProvenanceBuilder_ == null) { + if (sourceProvenance_ != null) { + sourceProvenance_ = + com.google.cloud.functions.v2.SourceProvenance.newBuilder(sourceProvenance_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceProvenance_ = value; + } + onChanged(); + } else { + sourceProvenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + onChanged(); + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.SourceProvenance.Builder getSourceProvenanceBuilder() { + + onChanged(); + return getSourceProvenanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.SourceProvenanceOrBuilder getSourceProvenanceOrBuilder() { + if (sourceProvenanceBuilder_ != null) { + return sourceProvenanceBuilder_.getMessageOrBuilder(); + } else { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.SourceProvenance, + com.google.cloud.functions.v2.SourceProvenance.Builder, + com.google.cloud.functions.v2.SourceProvenanceOrBuilder> + getSourceProvenanceFieldBuilder() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.SourceProvenance, + com.google.cloud.functions.v2.SourceProvenance.Builder, + com.google.cloud.functions.v2.SourceProvenanceOrBuilder>( + getSourceProvenance(), getParentForChildren(), isClean()); + sourceProvenance_ = null; + } + return sourceProvenanceBuilder_; + } + + private java.lang.Object workerPool_ = ""; + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + public java.lang.String getWorkerPool() { + java.lang.Object ref = workerPool_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerPool_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + public com.google.protobuf.ByteString getWorkerPoolBytes() { + java.lang.Object ref = workerPool_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The workerPool to set. + * @return This builder for chaining. + */ + public Builder setWorkerPool(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workerPool_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearWorkerPool() { + + workerPool_ = getDefaultInstance().getWorkerPool(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for workerPool to set. + * @return This builder for chaining. + */ + public Builder setWorkerPoolBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workerPool_ = value; + onChanged(); + 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(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEnvironmentVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnvironmentVariables() { + return internalGetMutableEnvironmentVariables().getMutableMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object dockerRepository_ = ""; + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + public java.lang.String getDockerRepository() { + java.lang.Object ref = dockerRepository_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerRepository_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + public com.google.protobuf.ByteString getDockerRepositoryBytes() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerRepository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The dockerRepository to set. + * @return This builder for chaining. + */ + public Builder setDockerRepository(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dockerRepository_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDockerRepository() { + + dockerRepository_ = getDefaultInstance().getDockerRepository(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for dockerRepository to set. + * @return This builder for chaining. + */ + public Builder setDockerRepositoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dockerRepository_ = 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.v2.BuildConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.BuildConfig) + private static final com.google.cloud.functions.v2.BuildConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.BuildConfig(); + } + + public static com.google.cloud.functions.v2.BuildConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuildConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BuildConfig(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.v2.BuildConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java new file mode 100644 index 00000000..b8c336d9 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java @@ -0,0 +1,351 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface BuildConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.BuildConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + java.lang.String getBuild(); + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + com.google.protobuf.ByteString getBuildBytes(); + + /** + * + * + *
+   * 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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + com.google.protobuf.ByteString getRuntimeBytes(); + + /** + * + * + *
+   * 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 = 3; + * + * @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 = 3; + * + * @return The bytes for entryPoint. + */ + com.google.protobuf.ByteString getEntryPointBytes(); + + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2.Source source = 4; + * + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2.Source source = 4; + * + * @return The source. + */ + com.google.cloud.functions.v2.Source getSource(); + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2.Source source = 4; + */ + com.google.cloud.functions.v2.SourceOrBuilder getSourceOrBuilder(); + + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + boolean hasSourceProvenance(); + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + com.google.cloud.functions.v2.SourceProvenance getSourceProvenance(); + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2.SourceProvenanceOrBuilder getSourceProvenanceOrBuilder(); + + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + java.lang.String getWorkerPool(); + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + com.google.protobuf.ByteString getWorkerPoolBytes(); + + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + boolean containsEnvironmentVariables(java.lang.String key); + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnvironmentVariables(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + + /* nullable */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + java.lang.String getDockerRepository(); + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + com.google.protobuf.ByteString getDockerRepositoryBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java new file mode 100644 index 00000000..e294a693 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java @@ -0,0 +1,1160 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request for the `CreateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.CreateFunctionRequest} + */ +public final class CreateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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() { + parent_ = ""; + functionId_ = ""; + } + + @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(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.functions.v2.Function.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v2.Function.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + functionId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.CreateFunctionRequest.class, + com.google.cloud.functions.v2.CreateFunctionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FUNCTION_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2.Function function_; + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2.Function 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.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Function getFunction() { + return function_ == null + ? com.google.cloud.functions.v2.Function.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.FunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int FUNCTION_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object functionId_; + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + @java.lang.Override + public java.lang.String getFunctionId() { + java.lang.Object ref = functionId_; + 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(); + functionId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFunctionIdBytes() { + java.lang.Object ref = functionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + functionId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (function_ != null) { + output.writeMessage(2, getFunction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(functionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, functionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFunction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(functionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, functionId_); + } + 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.v2.CreateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.CreateFunctionRequest other = + (com.google.cloud.functions.v2.CreateFunctionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (!getFunctionId().equals(other.getFunctionId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + hash = (37 * hash) + FUNCTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getFunctionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.CreateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.CreateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.CreateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.CreateFunctionRequest) + com.google.cloud.functions.v2.CreateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.CreateFunctionRequest.class, + com.google.cloud.functions.v2.CreateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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(); + parent_ = ""; + + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + functionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.CreateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.CreateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.CreateFunctionRequest build() { + com.google.cloud.functions.v2.CreateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.CreateFunctionRequest buildPartial() { + com.google.cloud.functions.v2.CreateFunctionRequest result = + new com.google.cloud.functions.v2.CreateFunctionRequest(this); + result.parent_ = parent_; + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + result.functionId_ = functionId_; + 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.v2.CreateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2.CreateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.CreateFunctionRequest other) { + if (other == com.google.cloud.functions.v2.CreateFunctionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + if (!other.getFunctionId().isEmpty()) { + functionId_ = other.functionId_; + 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.v2.CreateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.CreateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2.Function function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2.Function 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.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v2.Function getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v2.Function.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2.Function 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.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2.Function.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v2.Function value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v2.Function.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2.Function 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.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2.Function.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2.FunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v2.Function.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + private java.lang.Object functionId_ = ""; + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + public java.lang.String getFunctionId() { + java.lang.Object ref = functionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + public com.google.protobuf.ByteString getFunctionIdBytes() { + java.lang.Object ref = functionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + functionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @param value The functionId to set. + * @return This builder for chaining. + */ + public Builder setFunctionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + functionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearFunctionId() { + + functionId_ = getDefaultInstance().getFunctionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @param value The bytes for functionId to set. + * @return This builder for chaining. + */ + public Builder setFunctionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + functionId_ = 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.v2.CreateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.CreateFunctionRequest) + private static final com.google.cloud.functions.v2.CreateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.CreateFunctionRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.CreateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..f287ab5e --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface CreateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.CreateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v2.Function getFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v2.FunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + java.lang.String getFunctionId(); + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + com.google.protobuf.ByteString getFunctionIdBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequest.java new file mode 100644 index 00000000..f81ba572 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequest.java @@ -0,0 +1,652 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request for the `DeleteFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.DeleteFunctionRequest} + */ +public final class DeleteFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.DeleteFunctionRequest.class, + com.google.cloud.functions.v2.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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.v2.DeleteFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.DeleteFunctionRequest other = + (com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.DeleteFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.DeleteFunctionRequest) + com.google.cloud.functions.v2.DeleteFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.DeleteFunctionRequest.class, + com.google.cloud.functions.v2.DeleteFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.DeleteFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.DeleteFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.DeleteFunctionRequest build() { + com.google.cloud.functions.v2.DeleteFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.DeleteFunctionRequest buildPartial() { + com.google.cloud.functions.v2.DeleteFunctionRequest result = + new com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2.DeleteFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.DeleteFunctionRequest other) { + if (other == com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.DeleteFunctionRequest) + private static final com.google.cloud.functions.v2.DeleteFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.DeleteFunctionRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.DeleteFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/DeleteFunctionRequestOrBuilder.java new file mode 100644 index 00000000..a1e52167 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface DeleteFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.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-v2/src/main/java/com/google/cloud/functions/v2/Environment.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Environment.java new file mode 100644 index 00000000..e91c37b6 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Environment.java @@ -0,0 +1,176 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * The environment the function is hosted on.
+ * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.Environment} + */ +public enum Environment implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENVIRONMENT_UNSPECIFIED = 0; + */ + ENVIRONMENT_UNSPECIFIED(0), + /** + * + * + *
+   * Gen 1
+   * 
+ * + * GEN_1 = 1; + */ + GEN_1(1), + /** + * + * + *
+   * Gen 2
+   * 
+ * + * GEN_2 = 2; + */ + GEN_2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENVIRONMENT_UNSPECIFIED = 0; + */ + public static final int ENVIRONMENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Gen 1
+   * 
+ * + * GEN_1 = 1; + */ + public static final int GEN_1_VALUE = 1; + /** + * + * + *
+   * Gen 2
+   * 
+ * + * GEN_2 = 2; + */ + public static final int GEN_2_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 Environment 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 Environment forNumber(int value) { + switch (value) { + case 0: + return ENVIRONMENT_UNSPECIFIED; + case 1: + return GEN_1; + case 2: + return GEN_2; + 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 Environment findValueByNumber(int number) { + return Environment.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.v2.FunctionsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Environment[] VALUES = values(); + + public static Environment 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 Environment(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.Environment) +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilter.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilter.java new file mode 100644 index 00000000..0da961ef --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilter.java @@ -0,0 +1,1015 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Filters events based on exact matches on the CloudEvents attributes.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.EventFilter} + */ +public final class EventFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.EventFilter) + EventFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventFilter.newBuilder() to construct. + private EventFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventFilter() { + attribute_ = ""; + value_ = ""; + operator_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventFilter( + 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(); + + attribute_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + operator_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.EventFilter.class, + com.google.cloud.functions.v2.EventFilter.Builder.class); + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 1; + private volatile java.lang.Object attribute_; + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + @java.lang.Override + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + 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(); + attribute_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATOR_FIELD_NUMBER = 3; + private volatile java.lang.Object operator_; + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + @java.lang.Override + public java.lang.String getOperator() { + java.lang.Object ref = operator_; + 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(); + operator_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperatorBytes() { + java.lang.Object ref = operator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operator_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operator_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, operator_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operator_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, operator_); + } + 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.v2.EventFilter)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.EventFilter other = + (com.google.cloud.functions.v2.EventFilter) obj; + + if (!getAttribute().equals(other.getAttribute())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getOperator().equals(other.getOperator())) 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) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + OPERATOR_FIELD_NUMBER; + hash = (53 * hash) + getOperator().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.EventFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.EventFilter 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.v2.EventFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.EventFilter 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.v2.EventFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.EventFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.EventFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.EventFilter 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.v2.EventFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.EventFilter 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.v2.EventFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.EventFilter 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.v2.EventFilter 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; + } + /** + * + * + *
+   * Filters events based on exact matches on the CloudEvents attributes.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.EventFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.EventFilter) + com.google.cloud.functions.v2.EventFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.EventFilter.class, + com.google.cloud.functions.v2.EventFilter.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.EventFilter.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(); + attribute_ = ""; + + value_ = ""; + + operator_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.EventFilter getDefaultInstanceForType() { + return com.google.cloud.functions.v2.EventFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.EventFilter build() { + com.google.cloud.functions.v2.EventFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.EventFilter buildPartial() { + com.google.cloud.functions.v2.EventFilter result = + new com.google.cloud.functions.v2.EventFilter(this); + result.attribute_ = attribute_; + result.value_ = value_; + result.operator_ = operator_; + 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.v2.EventFilter) { + return mergeFrom((com.google.cloud.functions.v2.EventFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.EventFilter other) { + if (other == com.google.cloud.functions.v2.EventFilter.getDefaultInstance()) return this; + if (!other.getAttribute().isEmpty()) { + attribute_ = other.attribute_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (!other.getOperator().isEmpty()) { + operator_ = other.operator_; + 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.v2.EventFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.EventFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attribute_ = ""; + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attribute_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + + attribute_ = getDefaultInstance().getAttribute(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attribute_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private java.lang.Object operator_ = ""; + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + public java.lang.String getOperator() { + java.lang.Object ref = operator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operator_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + public com.google.protobuf.ByteString getOperatorBytes() { + java.lang.Object ref = operator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The operator to set. + * @return This builder for chaining. + */ + public Builder setOperator(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operator_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOperator() { + + operator_ = getDefaultInstance().getOperator(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for operator to set. + * @return This builder for chaining. + */ + public Builder setOperatorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operator_ = 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.v2.EventFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.EventFilter) + private static final com.google.cloud.functions.v2.EventFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.EventFilter(); + } + + public static com.google.cloud.functions.v2.EventFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventFilter(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.v2.EventFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilterOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilterOrBuilder.java new file mode 100644 index 00000000..0111e96c --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventFilterOrBuilder.java @@ -0,0 +1,106 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface EventFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.EventFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + java.lang.String getAttribute(); + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + com.google.protobuf.ByteString getAttributeBytes(); + + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + java.lang.String getOperator(); + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + com.google.protobuf.ByteString getOperatorBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java new file mode 100644 index 00000000..40613e1d --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java @@ -0,0 +1,2521 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Describes EventTrigger, used to request events to be sent from another
+ * service.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.EventTrigger} + */ +public final class EventTrigger extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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() { + trigger_ = ""; + triggerRegion_ = ""; + eventType_ = ""; + eventFilters_ = java.util.Collections.emptyList(); + pubsubTopic_ = ""; + serviceAccountEmail_ = ""; + retryPolicy_ = 0; + channel_ = ""; + } + + @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(); + } + 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(); + + trigger_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + triggerRegion_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + eventType_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + eventFilters_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + eventFilters_.add( + input.readMessage( + com.google.cloud.functions.v2.EventFilter.parser(), extensionRegistry)); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubTopic_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + retryPolicy_ = rawValue; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + channel_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + eventFilters_ = java.util.Collections.unmodifiableList(eventFilters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.EventTrigger.class, + com.google.cloud.functions.v2.EventTrigger.Builder.class); + } + + /** + * + * + *
+   * Describes the retry policy in case of function's execution failure.
+   * Retried execution is charged as any other execution.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.EventTrigger.RetryPolicy} + */ + public enum RetryPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RETRY_POLICY_UNSPECIFIED = 0; + */ + RETRY_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * Do not retry.
+     * 
+ * + * RETRY_POLICY_DO_NOT_RETRY = 1; + */ + RETRY_POLICY_DO_NOT_RETRY(1), + /** + * + * + *
+     * Retry on any failure, retry up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * 
+ * + * RETRY_POLICY_RETRY = 2; + */ + RETRY_POLICY_RETRY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RETRY_POLICY_UNSPECIFIED = 0; + */ + public static final int RETRY_POLICY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not retry.
+     * 
+ * + * RETRY_POLICY_DO_NOT_RETRY = 1; + */ + public static final int RETRY_POLICY_DO_NOT_RETRY_VALUE = 1; + /** + * + * + *
+     * Retry on any failure, retry up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * 
+ * + * RETRY_POLICY_RETRY = 2; + */ + public static final int RETRY_POLICY_RETRY_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 RetryPolicy 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 RetryPolicy forNumber(int value) { + switch (value) { + case 0: + return RETRY_POLICY_UNSPECIFIED; + case 1: + return RETRY_POLICY_DO_NOT_RETRY; + case 2: + return RETRY_POLICY_RETRY; + 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 RetryPolicy findValueByNumber(int number) { + return RetryPolicy.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.v2.EventTrigger.getDescriptor().getEnumTypes().get(0); + } + + private static final RetryPolicy[] VALUES = values(); + + public static RetryPolicy 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 RetryPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.EventTrigger.RetryPolicy) + } + + public static final int TRIGGER_FIELD_NUMBER = 1; + private volatile java.lang.Object trigger_; + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + @java.lang.Override + public java.lang.String getTrigger() { + java.lang.Object ref = trigger_; + 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(); + trigger_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerBytes() { + java.lang.Object ref = trigger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trigger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_REGION_FIELD_NUMBER = 2; + private volatile java.lang.Object triggerRegion_; + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + @java.lang.Override + public java.lang.String getTriggerRegion() { + java.lang.Object ref = triggerRegion_; + 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(); + triggerRegion_ = s; + return s; + } + } + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerRegionBytes() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + triggerRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 EVENT_FILTERS_FIELD_NUMBER = 4; + private java.util.List eventFilters_; + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + @java.lang.Override + public java.util.List getEventFiltersList() { + return eventFilters_; + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + @java.lang.Override + public java.util.List + getEventFiltersOrBuilderList() { + return eventFilters_; + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + @java.lang.Override + public int getEventFiltersCount() { + return eventFilters_.size(); + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2.EventFilter getEventFilters(int index) { + return eventFilters_.get(index); + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2.EventFilterOrBuilder getEventFiltersOrBuilder(int index) { + return eventFilters_.get(index); + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 5; + private volatile java.lang.Object pubsubTopic_; + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + @java.lang.Override + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + 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(); + pubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 6; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 RETRY_POLICY_FIELD_NUMBER = 7; + private int retryPolicy_; + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + @java.lang.Override + public int getRetryPolicyValue() { + return retryPolicy_; + } + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v2.EventTrigger.RetryPolicy getRetryPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.EventTrigger.RetryPolicy result = + com.google.cloud.functions.v2.EventTrigger.RetryPolicy.valueOf(retryPolicy_); + return result == null + ? com.google.cloud.functions.v2.EventTrigger.RetryPolicy.UNRECOGNIZED + : result; + } + + public static final int CHANNEL_FIELD_NUMBER = 8; + private volatile java.lang.Object channel_; + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + @java.lang.Override + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + 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(); + channel_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + channel_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trigger_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, trigger_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(triggerRegion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, triggerRegion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, eventType_); + } + for (int i = 0; i < eventFilters_.size(); i++) { + output.writeMessage(4, eventFilters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pubsubTopic_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAccountEmail_); + } + if (retryPolicy_ + != com.google.cloud.functions.v2.EventTrigger.RetryPolicy.RETRY_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, retryPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, channel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trigger_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, trigger_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(triggerRegion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, triggerRegion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, eventType_); + } + for (int i = 0; i < eventFilters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, eventFilters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pubsubTopic_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAccountEmail_); + } + if (retryPolicy_ + != com.google.cloud.functions.v2.EventTrigger.RetryPolicy.RETRY_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, retryPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, channel_); + } + 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.v2.EventTrigger)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.EventTrigger other = + (com.google.cloud.functions.v2.EventTrigger) obj; + + if (!getTrigger().equals(other.getTrigger())) return false; + if (!getTriggerRegion().equals(other.getTriggerRegion())) return false; + if (!getEventType().equals(other.getEventType())) return false; + if (!getEventFiltersList().equals(other.getEventFiltersList())) return false; + if (!getPubsubTopic().equals(other.getPubsubTopic())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (retryPolicy_ != other.retryPolicy_) return false; + if (!getChannel().equals(other.getChannel())) 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) + TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getTrigger().hashCode(); + hash = (37 * hash) + TRIGGER_REGION_FIELD_NUMBER; + hash = (53 * hash) + getTriggerRegion().hashCode(); + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + if (getEventFiltersCount() > 0) { + hash = (37 * hash) + EVENT_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getEventFiltersList().hashCode(); + } + hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTopic().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + RETRY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + retryPolicy_; + hash = (37 * hash) + CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + getChannel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.EventTrigger parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.EventTrigger parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.EventTrigger parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.EventTrigger parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.EventTrigger parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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 to be sent from another
+   * service.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.EventTrigger} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.EventTrigger) + com.google.cloud.functions.v2.EventTriggerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.EventTrigger.class, + com.google.cloud.functions.v2.EventTrigger.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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) { + getEventFiltersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + trigger_ = ""; + + triggerRegion_ = ""; + + eventType_ = ""; + + if (eventFiltersBuilder_ == null) { + eventFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + eventFiltersBuilder_.clear(); + } + pubsubTopic_ = ""; + + serviceAccountEmail_ = ""; + + retryPolicy_ = 0; + + channel_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_EventTrigger_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.EventTrigger getDefaultInstanceForType() { + return com.google.cloud.functions.v2.EventTrigger.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.EventTrigger build() { + com.google.cloud.functions.v2.EventTrigger result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.EventTrigger buildPartial() { + com.google.cloud.functions.v2.EventTrigger result = + new com.google.cloud.functions.v2.EventTrigger(this); + int from_bitField0_ = bitField0_; + result.trigger_ = trigger_; + result.triggerRegion_ = triggerRegion_; + result.eventType_ = eventType_; + if (eventFiltersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + eventFilters_ = java.util.Collections.unmodifiableList(eventFilters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.eventFilters_ = eventFilters_; + } else { + result.eventFilters_ = eventFiltersBuilder_.build(); + } + result.pubsubTopic_ = pubsubTopic_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.retryPolicy_ = retryPolicy_; + result.channel_ = channel_; + 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.v2.EventTrigger) { + return mergeFrom((com.google.cloud.functions.v2.EventTrigger) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.EventTrigger other) { + if (other == com.google.cloud.functions.v2.EventTrigger.getDefaultInstance()) return this; + if (!other.getTrigger().isEmpty()) { + trigger_ = other.trigger_; + onChanged(); + } + if (!other.getTriggerRegion().isEmpty()) { + triggerRegion_ = other.triggerRegion_; + onChanged(); + } + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (eventFiltersBuilder_ == null) { + if (!other.eventFilters_.isEmpty()) { + if (eventFilters_.isEmpty()) { + eventFilters_ = other.eventFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventFiltersIsMutable(); + eventFilters_.addAll(other.eventFilters_); + } + onChanged(); + } + } else { + if (!other.eventFilters_.isEmpty()) { + if (eventFiltersBuilder_.isEmpty()) { + eventFiltersBuilder_.dispose(); + eventFiltersBuilder_ = null; + eventFilters_ = other.eventFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + eventFiltersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventFiltersFieldBuilder() + : null; + } else { + eventFiltersBuilder_.addAllMessages(other.eventFilters_); + } + } + } + if (!other.getPubsubTopic().isEmpty()) { + pubsubTopic_ = other.pubsubTopic_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.retryPolicy_ != 0) { + setRetryPolicyValue(other.getRetryPolicyValue()); + } + if (!other.getChannel().isEmpty()) { + channel_ = other.channel_; + 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.v2.EventTrigger parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.EventTrigger) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object trigger_ = ""; + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + public java.lang.String getTrigger() { + java.lang.Object ref = trigger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trigger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + public com.google.protobuf.ByteString getTriggerBytes() { + java.lang.Object ref = trigger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trigger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The trigger to set. + * @return This builder for chaining. + */ + public Builder setTrigger(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + trigger_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTrigger() { + + trigger_ = getDefaultInstance().getTrigger(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for trigger to set. + * @return This builder for chaining. + */ + public Builder setTriggerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + trigger_ = value; + onChanged(); + return this; + } + + private java.lang.Object triggerRegion_ = ""; + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + public java.lang.String getTriggerRegion() { + java.lang.Object ref = triggerRegion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerRegion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + public com.google.protobuf.ByteString getTriggerRegionBytes() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + triggerRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @param value The triggerRegion to set. + * @return This builder for chaining. + */ + public Builder setTriggerRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + triggerRegion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return This builder for chaining. + */ + public Builder clearTriggerRegion() { + + triggerRegion_ = getDefaultInstance().getTriggerRegion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @param value The bytes for triggerRegion to set. + * @return This builder for chaining. + */ + public Builder setTriggerRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + triggerRegion_ = value; + onChanged(); + return this; + } + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @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.util.List eventFilters_ = + java.util.Collections.emptyList(); + + private void ensureEventFiltersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + eventFilters_ = + new java.util.ArrayList(eventFilters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.EventFilter, + com.google.cloud.functions.v2.EventFilter.Builder, + com.google.cloud.functions.v2.EventFilterOrBuilder> + eventFiltersBuilder_; + + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public java.util.List getEventFiltersList() { + if (eventFiltersBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventFilters_); + } else { + return eventFiltersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public int getEventFiltersCount() { + if (eventFiltersBuilder_ == null) { + return eventFilters_.size(); + } else { + return eventFiltersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2.EventFilter getEventFilters(int index) { + if (eventFiltersBuilder_ == null) { + return eventFilters_.get(index); + } else { + return eventFiltersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder setEventFilters(int index, com.google.cloud.functions.v2.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.set(index, value); + onChanged(); + } else { + eventFiltersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder setEventFilters( + int index, com.google.cloud.functions.v2.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.set(index, builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder addEventFilters(com.google.cloud.functions.v2.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.add(value); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder addEventFilters(int index, com.google.cloud.functions.v2.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.add(index, value); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + com.google.cloud.functions.v2.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.add(builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + int index, com.google.cloud.functions.v2.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.add(index, builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder addAllEventFilters( + java.lang.Iterable values) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventFilters_); + onChanged(); + } else { + eventFiltersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder clearEventFilters() { + if (eventFiltersBuilder_ == null) { + eventFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventFiltersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public Builder removeEventFilters(int index) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.remove(index); + onChanged(); + } else { + eventFiltersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2.EventFilter.Builder getEventFiltersBuilder(int index) { + return getEventFiltersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2.EventFilterOrBuilder getEventFiltersOrBuilder(int index) { + if (eventFiltersBuilder_ == null) { + return eventFilters_.get(index); + } else { + return eventFiltersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public java.util.List + getEventFiltersOrBuilderList() { + if (eventFiltersBuilder_ != null) { + return eventFiltersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventFilters_); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2.EventFilter.Builder addEventFiltersBuilder() { + return getEventFiltersFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.EventFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2.EventFilter.Builder addEventFiltersBuilder(int index) { + return getEventFiltersFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.EventFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + public java.util.List + getEventFiltersBuilderList() { + return getEventFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.EventFilter, + com.google.cloud.functions.v2.EventFilter.Builder, + com.google.cloud.functions.v2.EventFilterOrBuilder> + getEventFiltersFieldBuilder() { + if (eventFiltersBuilder_ == null) { + eventFiltersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.EventFilter, + com.google.cloud.functions.v2.EventFilter.Builder, + com.google.cloud.functions.v2.EventFilterOrBuilder>( + eventFilters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + eventFilters_ = null; + } + return eventFiltersBuilder_; + } + + private java.lang.Object pubsubTopic_ = ""; + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearPubsubTopic() { + + pubsubTopic_ = getDefaultInstance().getPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubTopic_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 int retryPolicy_ = 0; + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + @java.lang.Override + public int getRetryPolicyValue() { + return retryPolicy_; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for retryPolicy to set. + * @return This builder for chaining. + */ + public Builder setRetryPolicyValue(int value) { + + retryPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v2.EventTrigger.RetryPolicy getRetryPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.EventTrigger.RetryPolicy result = + com.google.cloud.functions.v2.EventTrigger.RetryPolicy.valueOf(retryPolicy_); + return result == null + ? com.google.cloud.functions.v2.EventTrigger.RetryPolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The retryPolicy to set. + * @return This builder for chaining. + */ + public Builder setRetryPolicy(com.google.cloud.functions.v2.EventTrigger.RetryPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + retryPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRetryPolicy() { + + retryPolicy_ = 0; + onChanged(); + return this; + } + + private java.lang.Object channel_ = ""; + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + channel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + public com.google.protobuf.ByteString getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The channel to set. + * @return This builder for chaining. + */ + public Builder setChannel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + channel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearChannel() { + + channel_ = getDefaultInstance().getChannel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for channel to set. + * @return This builder for chaining. + */ + public Builder setChannelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + channel_ = 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.v2.EventTrigger) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.EventTrigger) + private static final com.google.cloud.functions.v2.EventTrigger DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.EventTrigger(); + } + + public static com.google.cloud.functions.v2.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.v2.EventTrigger getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java new file mode 100644 index 00000000..c7c5d1e5 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java @@ -0,0 +1,302 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface EventTriggerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.EventTrigger) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + java.lang.String getTrigger(); + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + com.google.protobuf.ByteString getTriggerBytes(); + + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + java.lang.String getTriggerRegion(); + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + com.google.protobuf.ByteString getTriggerRegionBytes(); + + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + java.util.List getEventFiltersList(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + com.google.cloud.functions.v2.EventFilter getEventFilters(int index); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + int getEventFiltersCount(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + java.util.List + getEventFiltersOrBuilderList(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2.EventFilter event_filters = 4; + */ + com.google.cloud.functions.v2.EventFilterOrBuilder getEventFiltersOrBuilder(int index); + + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + java.lang.String getPubsubTopic(); + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + com.google.protobuf.ByteString getPubsubTopicBytes(); + + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + int getRetryPolicyValue(); + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + com.google.cloud.functions.v2.EventTrigger.RetryPolicy getRetryPolicy(); + + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + java.lang.String getChannel(); + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + com.google.protobuf.ByteString getChannelBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java new file mode 100644 index 00000000..8c0a8c92 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java @@ -0,0 +1,3393 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Describes a Cloud Function that contains user computation executed in
+ * response to an event. It encapsulates function and trigger configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.Function} + */ +public final class Function extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.Function) + FunctionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Function.newBuilder() to construct. + private Function(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Function() { + name_ = ""; + environment_ = 0; + description_ = ""; + state_ = 0; + stateMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Function(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Function( + 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: + { + com.google.cloud.functions.v2.BuildConfig.Builder subBuilder = null; + if (buildConfig_ != null) { + subBuilder = buildConfig_.toBuilder(); + } + buildConfig_ = + input.readMessage( + com.google.cloud.functions.v2.BuildConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildConfig_); + buildConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.functions.v2.ServiceConfig.Builder subBuilder = null; + if (serviceConfig_ != null) { + subBuilder = serviceConfig_.toBuilder(); + } + serviceConfig_ = + input.readMessage( + com.google.cloud.functions.v2.ServiceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceConfig_); + serviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.functions.v2.EventTrigger.Builder subBuilder = null; + if (eventTrigger_ != null) { + subBuilder = eventTrigger_.toBuilder(); + } + eventTrigger_ = + input.readMessage( + com.google.cloud.functions.v2.EventTrigger.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTrigger_); + eventTrigger_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 58: + { + 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 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + stateMessages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + stateMessages_.add( + input.readMessage( + com.google.cloud.functions.v2.StateMessage.parser(), extensionRegistry)); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + environment_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Function_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Function_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.Function.class, + com.google.cloud.functions.v2.Function.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of the function.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.Function.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Function has been successfully deployed and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Function deployment failed and the function is not serving.
+     * 
+ * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
+     * Function is being created or updated.
+     * 
+ * + * DEPLOYING = 3; + */ + DEPLOYING(3), + /** + * + * + *
+     * Function is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(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.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_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 is not serving.
+     * 
+ * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + /** + * + * + *
+     * Function is being created or updated.
+     * 
+ * + * DEPLOYING = 3; + */ + public static final int DEPLOYING_VALUE = 3; + /** + * + * + *
+     * Function is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_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 State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return FAILED; + case 3: + return DEPLOYING; + case 4: + return DELETING; + 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 State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2.Function.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.Function.State) + } + + 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 ENVIRONMENT_FIELD_NUMBER = 10; + private int environment_; + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Environment result = + com.google.cloud.functions.v2.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2.Environment.UNRECOGNIZED : result; + } + + 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 BUILD_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.functions.v2.BuildConfig buildConfig_; + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + @java.lang.Override + public boolean hasBuildConfig() { + return buildConfig_ != null; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfig getBuildConfig() { + return buildConfig_ == null + ? com.google.cloud.functions.v2.BuildConfig.getDefaultInstance() + : buildConfig_; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfigOrBuilder getBuildConfigOrBuilder() { + return getBuildConfig(); + } + + public static final int SERVICE_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.functions.v2.ServiceConfig serviceConfig_; + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + @java.lang.Override + public boolean hasServiceConfig() { + return serviceConfig_ != null; + } + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig getServiceConfig() { + return serviceConfig_ == null + ? com.google.cloud.functions.v2.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + return getServiceConfig(); + } + + public static final int EVENT_TRIGGER_FIELD_NUMBER = 5; + private com.google.cloud.functions.v2.EventTrigger eventTrigger_; + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + @java.lang.Override + public boolean hasEventTrigger() { + return eventTrigger_ != null; + } + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v2.EventTrigger getEventTrigger() { + return eventTrigger_ == null + ? com.google.cloud.functions.v2.EventTrigger.getDefaultInstance() + : eventTrigger_; + } + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + @java.lang.Override + public com.google.cloud.functions.v2.EventTriggerOrBuilder getEventTriggerOrBuilder() { + return getEventTrigger(); + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Function.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Function.State result = + com.google.cloud.functions.v2.Function.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2.Function.State.UNRECOGNIZED : result; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.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 = 7 [(.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 = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Function_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 = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_MESSAGES_FIELD_NUMBER = 9; + private java.util.List stateMessages_; + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getStateMessagesList() { + return stateMessages_; + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getStateMessagesOrBuilderList() { + return stateMessages_; + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getStateMessagesCount() { + return stateMessages_.size(); + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage getStateMessages(int index) { + return stateMessages_.get(index); + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder(int index) { + return stateMessages_.get(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 { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (buildConfig_ != null) { + output.writeMessage(3, getBuildConfig()); + } + if (serviceConfig_ != null) { + output.writeMessage(4, getServiceConfig()); + } + if (eventTrigger_ != null) { + output.writeMessage(5, getEventTrigger()); + } + if (state_ != com.google.cloud.functions.v2.Function.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + for (int i = 0; i < stateMessages_.size(); i++) { + output.writeMessage(9, stateMessages_.get(i)); + } + if (environment_ + != com.google.cloud.functions.v2.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + output.writeEnum(10, environment_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (buildConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBuildConfig()); + } + if (serviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getServiceConfig()); + } + if (eventTrigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEventTrigger()); + } + if (state_ != com.google.cloud.functions.v2.Function.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + for (int i = 0; i < stateMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, stateMessages_.get(i)); + } + if (environment_ + != com.google.cloud.functions.v2.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, environment_); + } + 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.v2.Function)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.Function other = (com.google.cloud.functions.v2.Function) obj; + + if (!getName().equals(other.getName())) return false; + if (environment_ != other.environment_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasBuildConfig() != other.hasBuildConfig()) return false; + if (hasBuildConfig()) { + if (!getBuildConfig().equals(other.getBuildConfig())) return false; + } + if (hasServiceConfig() != other.hasServiceConfig()) return false; + if (hasServiceConfig()) { + if (!getServiceConfig().equals(other.getServiceConfig())) return false; + } + if (hasEventTrigger() != other.hasEventTrigger()) return false; + if (hasEventTrigger()) { + if (!getEventTrigger().equals(other.getEventTrigger())) return false; + } + if (state_ != other.state_) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getStateMessagesList().equals(other.getStateMessagesList())) 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) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + environment_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasBuildConfig()) { + hash = (37 * hash) + BUILD_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBuildConfig().hashCode(); + } + if (hasServiceConfig()) { + hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfig().hashCode(); + } + if (hasEventTrigger()) { + hash = (37 * hash) + EVENT_TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getEventTrigger().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getStateMessagesCount() > 0) { + hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getStateMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.Function parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Function 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.v2.Function parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Function 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.v2.Function parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Function parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.Function parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Function 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.v2.Function parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Function 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.v2.Function parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Function 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.v2.Function 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 encapsulates function and trigger configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.Function} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.Function) + com.google.cloud.functions.v2.FunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Function_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Function_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.Function.class, + com.google.cloud.functions.v2.Function.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.Function.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStateMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + environment_ = 0; + + description_ = ""; + + if (buildConfigBuilder_ == null) { + buildConfig_ = null; + } else { + buildConfig_ = null; + buildConfigBuilder_ = null; + } + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + if (eventTriggerBuilder_ == null) { + eventTrigger_ = null; + } else { + eventTrigger_ = null; + eventTriggerBuilder_ = null; + } + state_ = 0; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Function_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.Function getDefaultInstanceForType() { + return com.google.cloud.functions.v2.Function.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.Function build() { + com.google.cloud.functions.v2.Function result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.Function buildPartial() { + com.google.cloud.functions.v2.Function result = + new com.google.cloud.functions.v2.Function(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.environment_ = environment_; + result.description_ = description_; + if (buildConfigBuilder_ == null) { + result.buildConfig_ = buildConfig_; + } else { + result.buildConfig_ = buildConfigBuilder_.build(); + } + if (serviceConfigBuilder_ == null) { + result.serviceConfig_ = serviceConfig_; + } else { + result.serviceConfig_ = serviceConfigBuilder_.build(); + } + if (eventTriggerBuilder_ == null) { + result.eventTrigger_ = eventTrigger_; + } else { + result.eventTrigger_ = eventTriggerBuilder_.build(); + } + result.state_ = state_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (stateMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.stateMessages_ = stateMessages_; + } else { + result.stateMessages_ = stateMessagesBuilder_.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.v2.Function) { + return mergeFrom((com.google.cloud.functions.v2.Function) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.Function other) { + if (other == com.google.cloud.functions.v2.Function.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.environment_ != 0) { + setEnvironmentValue(other.getEnvironmentValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasBuildConfig()) { + mergeBuildConfig(other.getBuildConfig()); + } + if (other.hasServiceConfig()) { + mergeServiceConfig(other.getServiceConfig()); + } + if (other.hasEventTrigger()) { + mergeEventTrigger(other.getEventTrigger()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (stateMessagesBuilder_ == null) { + if (!other.stateMessages_.isEmpty()) { + if (stateMessages_.isEmpty()) { + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureStateMessagesIsMutable(); + stateMessages_.addAll(other.stateMessages_); + } + onChanged(); + } + } else { + if (!other.stateMessages_.isEmpty()) { + if (stateMessagesBuilder_.isEmpty()) { + stateMessagesBuilder_.dispose(); + stateMessagesBuilder_ = null; + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + stateMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStateMessagesFieldBuilder() + : null; + } else { + stateMessagesBuilder_.addAllMessages(other.stateMessages_); + } + } + } + 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.v2.Function parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.Function) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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 int environment_ = 0; + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @param value The enum numeric value on the wire for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentValue(int value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Environment result = + com.google.cloud.functions.v2.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2.Environment.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(com.google.cloud.functions.v2.Environment value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = 0; + 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; + } + + private com.google.cloud.functions.v2.BuildConfig buildConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.BuildConfig, + com.google.cloud.functions.v2.BuildConfig.Builder, + com.google.cloud.functions.v2.BuildConfigOrBuilder> + buildConfigBuilder_; + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + public boolean hasBuildConfig() { + return buildConfigBuilder_ != null || buildConfig_ != null; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + public com.google.cloud.functions.v2.BuildConfig getBuildConfig() { + if (buildConfigBuilder_ == null) { + return buildConfig_ == null + ? com.google.cloud.functions.v2.BuildConfig.getDefaultInstance() + : buildConfig_; + } else { + return buildConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + public Builder setBuildConfig(com.google.cloud.functions.v2.BuildConfig value) { + if (buildConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildConfig_ = value; + onChanged(); + } else { + buildConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + public Builder setBuildConfig( + com.google.cloud.functions.v2.BuildConfig.Builder builderForValue) { + if (buildConfigBuilder_ == null) { + buildConfig_ = builderForValue.build(); + onChanged(); + } else { + buildConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + public Builder mergeBuildConfig(com.google.cloud.functions.v2.BuildConfig value) { + if (buildConfigBuilder_ == null) { + if (buildConfig_ != null) { + buildConfig_ = + com.google.cloud.functions.v2.BuildConfig.newBuilder(buildConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + buildConfig_ = value; + } + onChanged(); + } else { + buildConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + public Builder clearBuildConfig() { + if (buildConfigBuilder_ == null) { + buildConfig_ = null; + onChanged(); + } else { + buildConfig_ = null; + buildConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + public com.google.cloud.functions.v2.BuildConfig.Builder getBuildConfigBuilder() { + + onChanged(); + return getBuildConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + public com.google.cloud.functions.v2.BuildConfigOrBuilder getBuildConfigOrBuilder() { + if (buildConfigBuilder_ != null) { + return buildConfigBuilder_.getMessageOrBuilder(); + } else { + return buildConfig_ == null + ? com.google.cloud.functions.v2.BuildConfig.getDefaultInstance() + : buildConfig_; + } + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.BuildConfig, + com.google.cloud.functions.v2.BuildConfig.Builder, + com.google.cloud.functions.v2.BuildConfigOrBuilder> + getBuildConfigFieldBuilder() { + if (buildConfigBuilder_ == null) { + buildConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.BuildConfig, + com.google.cloud.functions.v2.BuildConfig.Builder, + com.google.cloud.functions.v2.BuildConfigOrBuilder>( + getBuildConfig(), getParentForChildren(), isClean()); + buildConfig_ = null; + } + return buildConfigBuilder_; + } + + private com.google.cloud.functions.v2.ServiceConfig serviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.ServiceConfig, + com.google.cloud.functions.v2.ServiceConfig.Builder, + com.google.cloud.functions.v2.ServiceConfigOrBuilder> + serviceConfigBuilder_; + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + public boolean hasServiceConfig() { + return serviceConfigBuilder_ != null || serviceConfig_ != null; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + public com.google.cloud.functions.v2.ServiceConfig getServiceConfig() { + if (serviceConfigBuilder_ == null) { + return serviceConfig_ == null + ? com.google.cloud.functions.v2.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } else { + return serviceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + public Builder setServiceConfig(com.google.cloud.functions.v2.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceConfig_ = value; + onChanged(); + } else { + serviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + public Builder setServiceConfig( + com.google.cloud.functions.v2.ServiceConfig.Builder builderForValue) { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = builderForValue.build(); + onChanged(); + } else { + serviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + public Builder mergeServiceConfig(com.google.cloud.functions.v2.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (serviceConfig_ != null) { + serviceConfig_ = + com.google.cloud.functions.v2.ServiceConfig.newBuilder(serviceConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceConfig_ = value; + } + onChanged(); + } else { + serviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + public Builder clearServiceConfig() { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + onChanged(); + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + public com.google.cloud.functions.v2.ServiceConfig.Builder getServiceConfigBuilder() { + + onChanged(); + return getServiceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + public com.google.cloud.functions.v2.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + if (serviceConfigBuilder_ != null) { + return serviceConfigBuilder_.getMessageOrBuilder(); + } else { + return serviceConfig_ == null + ? com.google.cloud.functions.v2.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.ServiceConfig, + com.google.cloud.functions.v2.ServiceConfig.Builder, + com.google.cloud.functions.v2.ServiceConfigOrBuilder> + getServiceConfigFieldBuilder() { + if (serviceConfigBuilder_ == null) { + serviceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.ServiceConfig, + com.google.cloud.functions.v2.ServiceConfig.Builder, + com.google.cloud.functions.v2.ServiceConfigOrBuilder>( + getServiceConfig(), getParentForChildren(), isClean()); + serviceConfig_ = null; + } + return serviceConfigBuilder_; + } + + private com.google.cloud.functions.v2.EventTrigger eventTrigger_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.EventTrigger, + com.google.cloud.functions.v2.EventTrigger.Builder, + com.google.cloud.functions.v2.EventTriggerOrBuilder> + eventTriggerBuilder_; + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + public boolean hasEventTrigger() { + return eventTriggerBuilder_ != null || eventTrigger_ != null; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + public com.google.cloud.functions.v2.EventTrigger getEventTrigger() { + if (eventTriggerBuilder_ == null) { + return eventTrigger_ == null + ? com.google.cloud.functions.v2.EventTrigger.getDefaultInstance() + : eventTrigger_; + } else { + return eventTriggerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + public Builder setEventTrigger(com.google.cloud.functions.v2.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTrigger_ = value; + onChanged(); + } else { + eventTriggerBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + public Builder setEventTrigger( + com.google.cloud.functions.v2.EventTrigger.Builder builderForValue) { + if (eventTriggerBuilder_ == null) { + eventTrigger_ = builderForValue.build(); + onChanged(); + } else { + eventTriggerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + public Builder mergeEventTrigger(com.google.cloud.functions.v2.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (eventTrigger_ != null) { + eventTrigger_ = + com.google.cloud.functions.v2.EventTrigger.newBuilder(eventTrigger_) + .mergeFrom(value) + .buildPartial(); + } else { + eventTrigger_ = value; + } + onChanged(); + } else { + eventTriggerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + public Builder clearEventTrigger() { + if (eventTriggerBuilder_ == null) { + eventTrigger_ = null; + onChanged(); + } else { + eventTrigger_ = null; + eventTriggerBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + public com.google.cloud.functions.v2.EventTrigger.Builder getEventTriggerBuilder() { + + onChanged(); + return getEventTriggerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + public com.google.cloud.functions.v2.EventTriggerOrBuilder getEventTriggerOrBuilder() { + if (eventTriggerBuilder_ != null) { + return eventTriggerBuilder_.getMessageOrBuilder(); + } else { + return eventTrigger_ == null + ? com.google.cloud.functions.v2.EventTrigger.getDefaultInstance() + : eventTrigger_; + } + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.EventTrigger, + com.google.cloud.functions.v2.EventTrigger.Builder, + com.google.cloud.functions.v2.EventTriggerOrBuilder> + getEventTriggerFieldBuilder() { + if (eventTriggerBuilder_ == null) { + eventTriggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.EventTrigger, + com.google.cloud.functions.v2.EventTrigger.Builder, + com.google.cloud.functions.v2.EventTriggerOrBuilder>( + getEventTrigger(), getParentForChildren(), isClean()); + eventTrigger_ = null; + } + return eventTriggerBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Function.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Function.State result = + com.google.cloud.functions.v2.Function.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2.Function.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.functions.v2.Function.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + 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 = 7 [(.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 = 7 [(.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 = 7 [(.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 = 7 [(.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 = 7 [(.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 = 7 [(.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 = 7 [(.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 = 7 [(.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 = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.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 = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List stateMessages_ = + java.util.Collections.emptyList(); + + private void ensureStateMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + stateMessages_ = + new java.util.ArrayList(stateMessages_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.StateMessage, + com.google.cloud.functions.v2.StateMessage.Builder, + com.google.cloud.functions.v2.StateMessageOrBuilder> + stateMessagesBuilder_; + + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getStateMessagesList() { + if (stateMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stateMessages_); + } else { + return stateMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getStateMessagesCount() { + if (stateMessagesBuilder_ == null) { + return stateMessages_.size(); + } else { + return stateMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.StateMessage getStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateMessages(int index, com.google.cloud.functions.v2.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.set(index, value); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages(com.google.cloud.functions.v2.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages(int index, com.google.cloud.functions.v2.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(index, value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + com.google.cloud.functions.v2.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllStateMessages( + java.lang.Iterable values) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stateMessages_); + onChanged(); + } else { + stateMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateMessages() { + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.remove(index); + onChanged(); + } else { + stateMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.StateMessage.Builder getStateMessagesBuilder(int index) { + return getStateMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStateMessagesOrBuilderList() { + if (stateMessagesBuilder_ != null) { + return stateMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stateMessages_); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.StateMessage.Builder addStateMessagesBuilder() { + return getStateMessagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2.StateMessage.Builder addStateMessagesBuilder(int index) { + return getStateMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStateMessagesBuilderList() { + return getStateMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.StateMessage, + com.google.cloud.functions.v2.StateMessage.Builder, + com.google.cloud.functions.v2.StateMessageOrBuilder> + getStateMessagesFieldBuilder() { + if (stateMessagesBuilder_ == null) { + stateMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.StateMessage, + com.google.cloud.functions.v2.StateMessage.Builder, + com.google.cloud.functions.v2.StateMessageOrBuilder>( + stateMessages_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + stateMessages_ = null; + } + return stateMessagesBuilder_; + } + + @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.v2.Function) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.Function) + private static final com.google.cloud.functions.v2.Function DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.Function(); + } + + public static com.google.cloud.functions.v2.Function getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Function parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Function(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.v2.Function getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionName.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionName.java new file mode 100644 index 00000000..e632262a --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2022 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.v2; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FunctionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FUNCTION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/functions/{function}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String function; + + @Deprecated + protected FunctionName() { + project = null; + location = null; + function = null; + } + + private FunctionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + function = Preconditions.checkNotNull(builder.getFunction()); + } + + 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); + } + + public static FunctionName 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 FunctionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FUNCTION.validatedMatch( + formattedString, "FunctionName.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 (FunctionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FUNCTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (function != null) { + fieldMapBuilder.put("function", function); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FUNCTION.instantiate( + "project", project, "location", location, "function", function); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FunctionName that = ((FunctionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.function, that.function); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(function); + return h; + } + + /** Builder for projects/{project}/locations/{location}/functions/{function}. */ + public static class Builder { + private String project; + private String location; + private String function; + + protected Builder() {} + + 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(FunctionName functionName) { + this.project = functionName.project; + this.location = functionName.location; + this.function = functionName.function; + } + + public FunctionName build() { + return new FunctionName(this); + } + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java new file mode 100644 index 00000000..278a7acf --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java @@ -0,0 +1,404 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface FunctionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.Function) + 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(); + + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + int getEnvironmentValue(); + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2.Environment environment = 10; + * + * @return The environment. + */ + com.google.cloud.functions.v2.Environment getEnvironment(); + + /** + * + * + *
+   * 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(); + + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + boolean hasBuildConfig(); + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + com.google.cloud.functions.v2.BuildConfig getBuildConfig(); + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2.BuildConfig build_config = 3; + */ + com.google.cloud.functions.v2.BuildConfigOrBuilder getBuildConfigOrBuilder(); + + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + boolean hasServiceConfig(); + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + com.google.cloud.functions.v2.ServiceConfig getServiceConfig(); + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig service_config = 4; + */ + com.google.cloud.functions.v2.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + boolean hasEventTrigger(); + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + com.google.cloud.functions.v2.EventTrigger getEventTrigger(); + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2.EventTrigger event_trigger = 5; + */ + com.google.cloud.functions.v2.EventTriggerOrBuilder getEventTriggerOrBuilder(); + + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.functions.v2.Function.State getState(); + + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.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 = 7 [(.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 = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getStateMessagesList(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2.StateMessage getStateMessages(int index); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getStateMessagesCount(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getStateMessagesOrBuilderList(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java new file mode 100644 index 00000000..d518186d --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java @@ -0,0 +1,747 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +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_v2_Function_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_Function_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_Function_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_Function_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_StateMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_StateMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_StorageSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_StorageSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_RepoSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_RepoSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_Source_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_Source_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_SourceProvenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_SourceProvenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_BuildConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_BuildConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_BuildConfig_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_BuildConfig_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ServiceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ServiceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ServiceConfig_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ServiceConfig_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_SecretEnvVar_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_SecretEnvVar_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_SecretVolume_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_SecretVolume_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_EventTrigger_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_EventTrigger_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_EventFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_EventFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_GetFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_GetFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ListFunctionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ListFunctionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ListFunctionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ListFunctionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_CreateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_CreateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_UpdateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_UpdateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_DeleteFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_DeleteFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ListRuntimesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ListRuntimesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ListRuntimesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2_Stage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2_Stage_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/v2/functions.pr" + + "oto\022\031google.cloud.functions.v2\032\034google/a" + + "pi/annotations.proto\032\027google/api/client." + + "proto\032\037google/api/field_behavior.proto\032\031" + + "google/api/resource.proto\032#google/longru" + + "nning/operations.proto\032\031google/protobuf/" + + "any.proto\032 google/protobuf/field_mask.pr" + + "oto\032\037google/protobuf/timestamp.proto\"\267\006\n" + + "\010Function\022\014\n\004name\030\001 \001(\t\022;\n\013environment\030\n" + + " \001(\0162&.google.cloud.functions.v2.Environ" + + "ment\022\023\n\013description\030\002 \001(\t\022<\n\014build_confi" + + "g\030\003 \001(\0132&.google.cloud.functions.v2.Buil" + + "dConfig\022@\n\016service_config\030\004 \001(\0132(.google" + + ".cloud.functions.v2.ServiceConfig\022>\n\reve" + + "nt_trigger\030\005 \001(\0132\'.google.cloud.function" + + "s.v2.EventTrigger\022=\n\005state\030\006 \001(\0162).googl" + + "e.cloud.functions.v2.Function.StateB\003\340A\003" + + "\0224\n\013update_time\030\007 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\022?\n\006labels\030\010 \003(\0132/.google." + + "cloud.functions.v2.Function.LabelsEntry\022" + + "D\n\016state_messages\030\t \003(\0132\'.google.cloud.f" + + "unctions.v2.StateMessageB\003\340A\003\032-\n\013LabelsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\005" + + "State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001" + + "\022\n\n\006FAILED\020\002\022\r\n\tDEPLOYING\020\003\022\014\n\010DELETING\020" + + "\004\022\013\n\007UNKNOWN\020\005:~\352A{\n&cloudfunctions.goog" + + "leapis.com/Function\022\n\013worker_pool\030\005 \001(\tB)\372A&\n$cloudbuild.go" + + "ogleapis.com/WorkerPool\022_\n\025environment_v" + + "ariables\030\006 \003(\0132@.google.cloud.functions." + + "v2.BuildConfig.EnvironmentVariablesEntry" + + "\022M\n\021docker_repository\030\007 \001(\tB2\340A\001\372A,\n*art" + + "ifactregistry.googleapis.com/Repository\032" + + ";\n\031EnvironmentVariablesEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\300\010\n\rServiceConfig\0223" + + "\n\007service\030\001 \001(\tB\"\340A\003\372A\034\n\032run.googleapis." + + "com/Service\022\027\n\017timeout_seconds\030\002 \001(\005\022\030\n\020" + + "available_memory\030\r \001(\t\022a\n\025environment_va" + + "riables\030\004 \003(\0132B.google.cloud.functions.v" + + "2.ServiceConfig.EnvironmentVariablesEntr" + + "y\022\032\n\022max_instance_count\030\005 \001(\005\022\032\n\022min_ins" + + "tance_count\030\014 \001(\005\022>\n\rvpc_connector\030\006 \001(\t" + + "B\'\372A$\n\"vpcaccess.googleapis.com/Connecto" + + "r\022j\n\035vpc_connector_egress_settings\030\007 \001(\016" + + "2C.google.cloud.functions.v2.ServiceConf" + + "ig.VpcConnectorEgressSettings\022R\n\020ingress" + + "_settings\030\010 \001(\01628.google.cloud.functions" + + ".v2.ServiceConfig.IngressSettings\022\020\n\003uri" + + "\030\t \001(\tB\003\340A\003\022\035\n\025service_account_email\030\n \001" + + "(\t\022&\n\036all_traffic_on_latest_revision\030\020 \001" + + "(\010\022M\n\034secret_environment_variables\030\021 \003(\013" + + "2\'.google.cloud.functions.v2.SecretEnvVa" + + "r\022?\n\016secret_volumes\030\023 \003(\0132\'.google.cloud" + + ".functions.v2.SecretVolume\022\025\n\010revision\030\022" + + " \001(\tB\003\340A\003\032;\n\031EnvironmentVariablesEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u\n\032VpcCon" + + "nectorEgressSettings\022-\n)VPC_CONNECTOR_EG" + + "RESS_SETTINGS_UNSPECIFIED\020\000\022\027\n\023PRIVATE_R" + + "ANGES_ONLY\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n\017Ingress" + + "Settings\022 \n\034INGRESS_SETTINGS_UNSPECIFIED" + + "\020\000\022\r\n\tALLOW_ALL\020\001\022\027\n\023ALLOW_INTERNAL_ONLY" + + "\020\002\022\033\n\027ALLOW_INTERNAL_AND_GCLB\020\003\"P\n\014Secre" + + "tEnvVar\022\013\n\003key\030\001 \001(\t\022\022\n\nproject_id\030\002 \001(\t" + + "\022\016\n\006secret\030\003 \001(\t\022\017\n\007version\030\004 \001(\t\"\277\001\n\014Se" + + "cretVolume\022\022\n\nmount_path\030\001 \001(\t\022\022\n\nprojec" + + "t_id\030\002 \001(\t\022\016\n\006secret\030\003 \001(\t\022G\n\010versions\030\004" + + " \003(\01325.google.cloud.functions.v2.SecretV" + + "olume.SecretVersion\032.\n\rSecretVersion\022\017\n\007" + + "version\030\001 \001(\t\022\014\n\004path\030\002 \001(\t\"\205\004\n\014EventTri" + + "gger\0228\n\007trigger\030\001 \001(\tB\'\340A\003\372A!\n\037eventarc." + + "googleapis.com/Trigger\022\026\n\016trigger_region" + + "\030\002 \001(\t\022\027\n\nevent_type\030\003 \001(\tB\003\340A\002\022=\n\revent" + + "_filters\030\004 \003(\0132&.google.cloud.functions." + + "v2.EventFilter\0229\n\014pubsub_topic\030\005 \001(\tB#\340A" + + "\001\372A\035\n\033pubsub.googleapis.com/Topic\022\"\n\025ser" + + "vice_account_email\030\006 \001(\tB\003\340A\001\022N\n\014retry_p" + + "olicy\030\007 \001(\01623.google.cloud.functions.v2." + + "EventTrigger.RetryPolicyB\003\340A\001\0228\n\007channel" + + "\030\010 \001(\tB\'\340A\001\372A!\n\037eventarc.googleapis.com/" + + "Channel\"b\n\013RetryPolicy\022\034\n\030RETRY_POLICY_U" + + "NSPECIFIED\020\000\022\035\n\031RETRY_POLICY_DO_NOT_RETR" + + "Y\020\001\022\026\n\022RETRY_POLICY_RETRY\020\002\"P\n\013EventFilt" + + "er\022\026\n\tattribute\030\001 \001(\tB\003\340A\002\022\022\n\005value\030\002 \001(" + + "\tB\003\340A\002\022\025\n\010operator\030\003 \001(\tB\003\340A\001\"R\n\022GetFunc" + + "tionRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&cloud" + + "functions.googleapis.com/Function\"\237\001\n\024Li" + + "stFunctionsRequest\022>\n\006parent\030\001 \001(\tB.\340A\002\372" + + "A(\022&cloudfunctions.googleapis.com/Functi" + + "on\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" + + "\t\022\016\n\006filter\030\004 \001(\t\022\020\n\010order_by\030\005 \001(\t\"}\n\025L" + + "istFunctionsResponse\0226\n\tfunctions\030\001 \003(\0132" + + "#.google.cloud.functions.v2.Function\022\027\n\017" + + "next_page_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003" + + "(\t\"\243\001\n\025CreateFunctionRequest\0229\n\006parent\030\001" + + " \001(\tB)\340A\002\372A#\n!locations.googleapis.com/L" + + "ocation\022:\n\010function\030\002 \001(\0132#.google.cloud" + + ".functions.v2.FunctionB\003\340A\002\022\023\n\013function_" + + "id\030\003 \001(\t\"\204\001\n\025UpdateFunctionRequest\022:\n\010fu" + + "nction\030\001 \001(\0132#.google.cloud.functions.v2" + + ".FunctionB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.go" + + "ogle.protobuf.FieldMask\"U\n\025DeleteFunctio" + + "nRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&cloudfun" + + "ctions.googleapis.com/Function\"U\n\030Genera" + + "teUploadUrlRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372" + + "A#\n!locations.googleapis.com/Location\"q\n" + + "\031GenerateUploadUrlResponse\022\022\n\nupload_url" + + "\030\001 \001(\t\022@\n\016storage_source\030\002 \001(\0132(.google." + + "cloud.functions.v2.StorageSource\"Z\n\032Gene" + + "rateDownloadUrlRequest\022<\n\004name\030\001 \001(\tB.\340A" + + "\002\372A(\n&cloudfunctions.googleapis.com/Func" + + "tion\"3\n\033GenerateDownloadUrlResponse\022\024\n\014d" + + "ownload_url\030\001 \001(\t\"`\n\023ListRuntimesRequest" + + "\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.goog" + + "leapis.com/Location\022\016\n\006filter\030\002 \001(\t\"\256\003\n\024" + + "ListRuntimesResponse\022I\n\010runtimes\030\001 \003(\01327" + + ".google.cloud.functions.v2.ListRuntimesR" + + "esponse.Runtime\032\311\001\n\007Runtime\022\014\n\004name\030\001 \001(" + + "\t\022\024\n\014display_name\030\005 \001(\t\022K\n\005stage\030\002 \001(\0162<" + + ".google.cloud.functions.v2.ListRuntimesR" + + "esponse.RuntimeStage\022\020\n\010warnings\030\003 \003(\t\022;" + + "\n\013environment\030\004 \001(\0162&.google.cloud.funct" + + "ions.v2.Environment\"\177\n\014RuntimeStage\022\035\n\031R" + + "UNTIME_STAGE_UNSPECIFIED\020\000\022\017\n\013DEVELOPMEN" + + "T\020\001\022\t\n\005ALPHA\020\002\022\010\n\004BETA\020\003\022\006\n\002GA\020\004\022\016\n\nDEPR" + + "ECATED\020\005\022\022\n\016DECOMMISSIONED\020\006\"\270\002\n\021Operati" + + "onMetadata\022/\n\013create_time\030\001 \001(\0132\032.google" + + ".protobuf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032." + + "google.protobuf.Timestamp\022\016\n\006target\030\003 \001(" + + "\t\022\014\n\004verb\030\004 \001(\t\022\025\n\rstatus_detail\030\005 \001(\t\022\030" + + "\n\020cancel_requested\030\006 \001(\010\022\023\n\013api_version\030" + + "\007 \001(\t\022.\n\020request_resource\030\010 \001(\0132\024.google" + + ".protobuf.Any\0220\n\006stages\030\t \003(\0132 .google.c" + + "loud.functions.v2.Stage\"\304\003\n\005Stage\0223\n\004nam" + + "e\030\001 \001(\0162%.google.cloud.functions.v2.Stag" + + "e.Name\022\017\n\007message\030\002 \001(\t\0225\n\005state\030\003 \001(\0162&" + + ".google.cloud.functions.v2.Stage.State\022\020" + + "\n\010resource\030\004 \001(\t\022\024\n\014resource_uri\030\005 \001(\t\022?" + + "\n\016state_messages\030\006 \003(\0132\'.google.cloud.fu" + + "nctions.v2.StateMessage\"\204\001\n\004Name\022\024\n\020NAME" + + "_UNSPECIFIED\020\000\022\025\n\021ARTIFACT_REGISTRY\020\001\022\t\n" + + "\005BUILD\020\002\022\013\n\007SERVICE\020\003\022\013\n\007TRIGGER\020\004\022\024\n\020SE" + + "RVICE_ROLLBACK\020\005\022\024\n\020TRIGGER_ROLLBACK\020\006\"N" + + "\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\017\n\013NOT_ST" + + "ARTED\020\001\022\017\n\013IN_PROGRESS\020\002\022\014\n\010COMPLETE\020\003*@" + + "\n\013Environment\022\033\n\027ENVIRONMENT_UNSPECIFIED" + + "\020\000\022\t\n\005GEN_1\020\001\022\t\n\005GEN_2\020\0022\252\016\n\017FunctionSer" + + "vice\022\237\001\n\013GetFunction\022-.google.cloud.func" + + "tions.v2.GetFunctionRequest\032#.google.clo" + + "ud.functions.v2.Function\"<\202\323\344\223\002/\022-/v2/{n" + + "ame=projects/*/locations/*/functions/*}\332" + + "A\004name\022\262\001\n\rListFunctions\022/.google.cloud." + + "functions.v2.ListFunctionsRequest\0320.goog" + + "le.cloud.functions.v2.ListFunctionsRespo" + + "nse\">\202\323\344\223\002/\022-/v2/{parent=projects/*/loca" + + "tions/*}/functions\332A\006parent\022\225\002\n\016CreateFu" + + "nction\0220.google.cloud.functions.v2.Creat" + + "eFunctionRequest\032\035.google.longrunning.Op" + + "eration\"\261\001\202\323\344\223\0029\"-/v2/{parent=projects/*" + + "/locations/*}/functions:\010function\332A\033pare" + + "nt,function,function_id\312AQ\n\"google.cloud" + + ".functions.v2.Function\022+google.cloud.fun" + + "ctions.v2.OperationMetadata\022\227\002\n\016UpdateFu" + + "nction\0220.google.cloud.functions.v2.Updat" + + "eFunctionRequest\032\035.google.longrunning.Op" + + "eration\"\263\001\202\323\344\223\002B26/v2/{function.name=pro" + + "jects/*/locations/*/functions/*}:\010functi" + + "on\332A\024function,update_mask\312AQ\n\"google.clo" + + "ud.functions.v2.Function\022+google.cloud.f" + + "unctions.v2.OperationMetadata\022\347\001\n\016Delete" + + "Function\0220.google.cloud.functions.v2.Del" + + "eteFunctionRequest\032\035.google.longrunning." + + "Operation\"\203\001\202\323\344\223\002/*-/v2/{name=projects/*" + + "/locations/*/functions/*}\332A\004name\312AD\n\025goo" + + "gle.protobuf.Empty\022+google.cloud.functio" + + "ns.v2.OperationMetadata\022\312\001\n\021GenerateUplo" + + "adUrl\0223.google.cloud.functions.v2.Genera" + + "teUploadUrlRequest\0324.google.cloud.functi" + + "ons.v2.GenerateUploadUrlResponse\"J\202\323\344\223\002D" + + "\"?/v2/{parent=projects/*/locations/*}/fu" + + "nctions:generateUploadUrl:\001*\022\322\001\n\023Generat" + + "eDownloadUrl\0225.google.cloud.functions.v2" + + ".GenerateDownloadUrlRequest\0326.google.clo" + + "ud.functions.v2.GenerateDownloadUrlRespo" + + "nse\"L\202\323\344\223\002F\"A/v2/{name=projects/*/locati" + + "ons/*/functions/*}:generateDownloadUrl:\001" + + "*\022\256\001\n\014ListRuntimes\022..google.cloud.functi" + + "ons.v2.ListRuntimesRequest\032/.google.clou" + + "d.functions.v2.ListRuntimesResponse\"=\202\323\344" + + "\223\002.\022,/v2/{parent=projects/*/locations/*}" + + "/runtimes\332A\006parent\032Q\312A\035cloudfunctions.go" + + "ogleapis.com\322A.https://www.googleapis.co" + + "m/auth/cloud-platformB\365\007\n\035com.google.clo" + + "ud.functions.v2B\016FunctionsProtoP\001ZBgoogl" + + "e.golang.org/genproto/googleapis/cloud/f" + + "unctions/v2;functions\242\002\003GCF\352Ao\n*artifact" + + "registry.googleapis.com/Repository\022Aproj" + + "ects/{project}/locations/{location}/repo" + + "sitories/{repository}\352AY\n\037cloudbuild.goo" + + "gleapis.com/Build\0226projects/{project}/lo" + + "cations/{location}/builds/{build}\352Ai\n$cl" + + "oudbuild.googleapis.com/WorkerPool\022Aproj" + + "ects/{project}/locations/{location}/work" + + "erPools/{worker_pool}\352AX\n\032run.googleapis" + + ".com/Service\022:projects/{project}/locatio" + + "ns/{location}/services/{service}\352Ad\n\"vpc" + + "access.googleapis.com/Connector\022>project" + + "s/{project}/locations/{location}/connect" + + "ors/{connector}\352A]\n\037eventarc.googleapis." + + "com/Trigger\022:projects/{project}/location" + + "s/{location}/triggers/{trigger}\352A]\n\037even" + + "tarc.googleapis.com/Channel\022:projects/{p" + + "roject}/locations/{location}/channels/{c" + + "hannel}\352A@\n\033pubsub.googleapis.com/Topic\022" + + "!projects/{project}/topics/{topic}\352Ax\n!c" + + "loudkms.googleapis.com/CryptoKey\022Sprojec" + + "ts/{project}/locations/{location}/keyRin" + + "gs/{key_ring}/cryptoKeys/{crypto_key}b\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_functions_v2_Function_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_functions_v2_Function_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_Function_descriptor, + new java.lang.String[] { + "Name", + "Environment", + "Description", + "BuildConfig", + "ServiceConfig", + "EventTrigger", + "State", + "UpdateTime", + "Labels", + "StateMessages", + }); + internal_static_google_cloud_functions_v2_Function_LabelsEntry_descriptor = + internal_static_google_cloud_functions_v2_Function_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v2_Function_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_Function_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2_StateMessage_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_functions_v2_StateMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_StateMessage_descriptor, + new java.lang.String[] { + "Severity", "Type", "Message", + }); + internal_static_google_cloud_functions_v2_StorageSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_functions_v2_StorageSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_StorageSource_descriptor, + new java.lang.String[] { + "Bucket", "Object", "Generation", + }); + internal_static_google_cloud_functions_v2_RepoSource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_functions_v2_RepoSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_RepoSource_descriptor, + new java.lang.String[] { + "BranchName", + "TagName", + "CommitSha", + "ProjectId", + "RepoName", + "Dir", + "InvertRegex", + "Revision", + }); + internal_static_google_cloud_functions_v2_Source_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_functions_v2_Source_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_Source_descriptor, + new java.lang.String[] { + "StorageSource", "RepoSource", "Source", + }); + internal_static_google_cloud_functions_v2_SourceProvenance_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_functions_v2_SourceProvenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_SourceProvenance_descriptor, + new java.lang.String[] { + "ResolvedStorageSource", "ResolvedRepoSource", + }); + internal_static_google_cloud_functions_v2_BuildConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_functions_v2_BuildConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_BuildConfig_descriptor, + new java.lang.String[] { + "Build", + "Runtime", + "EntryPoint", + "Source", + "SourceProvenance", + "WorkerPool", + "EnvironmentVariables", + "DockerRepository", + }); + internal_static_google_cloud_functions_v2_BuildConfig_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v2_BuildConfig_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v2_BuildConfig_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_BuildConfig_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2_ServiceConfig_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_functions_v2_ServiceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ServiceConfig_descriptor, + new java.lang.String[] { + "Service", + "TimeoutSeconds", + "AvailableMemory", + "EnvironmentVariables", + "MaxInstanceCount", + "MinInstanceCount", + "VpcConnector", + "VpcConnectorEgressSettings", + "IngressSettings", + "Uri", + "ServiceAccountEmail", + "AllTrafficOnLatestRevision", + "SecretEnvironmentVariables", + "SecretVolumes", + "Revision", + }); + internal_static_google_cloud_functions_v2_ServiceConfig_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v2_ServiceConfig_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v2_ServiceConfig_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ServiceConfig_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2_SecretEnvVar_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_functions_v2_SecretEnvVar_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_SecretEnvVar_descriptor, + new java.lang.String[] { + "Key", "ProjectId", "Secret", "Version", + }); + internal_static_google_cloud_functions_v2_SecretVolume_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_functions_v2_SecretVolume_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_SecretVolume_descriptor, + new java.lang.String[] { + "MountPath", "ProjectId", "Secret", "Versions", + }); + internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_descriptor = + internal_static_google_cloud_functions_v2_SecretVolume_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_descriptor, + new java.lang.String[] { + "Version", "Path", + }); + internal_static_google_cloud_functions_v2_EventTrigger_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_functions_v2_EventTrigger_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_EventTrigger_descriptor, + new java.lang.String[] { + "Trigger", + "TriggerRegion", + "EventType", + "EventFilters", + "PubsubTopic", + "ServiceAccountEmail", + "RetryPolicy", + "Channel", + }); + internal_static_google_cloud_functions_v2_EventFilter_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_functions_v2_EventFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_EventFilter_descriptor, + new java.lang.String[] { + "Attribute", "Value", "Operator", + }); + internal_static_google_cloud_functions_v2_GetFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_functions_v2_GetFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_GetFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2_ListFunctionsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_functions_v2_ListFunctionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ListFunctionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_functions_v2_ListFunctionsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_functions_v2_ListFunctionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ListFunctionsResponse_descriptor, + new java.lang.String[] { + "Functions", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_functions_v2_CreateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_functions_v2_CreateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_CreateFunctionRequest_descriptor, + new java.lang.String[] { + "Parent", "Function", "FunctionId", + }); + internal_static_google_cloud_functions_v2_UpdateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_functions_v2_UpdateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_UpdateFunctionRequest_descriptor, + new java.lang.String[] { + "Function", "UpdateMask", + }); + internal_static_google_cloud_functions_v2_DeleteFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_functions_v2_DeleteFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_DeleteFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor, + new java.lang.String[] { + "UploadUrl", "StorageSource", + }); + internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_descriptor, + new java.lang.String[] { + "DownloadUrl", + }); + internal_static_google_cloud_functions_v2_ListRuntimesRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_functions_v2_ListRuntimesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ListRuntimesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", + }); + internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_functions_v2_ListRuntimesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor, + new java.lang.String[] { + "Runtimes", + }); + internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_descriptor = + internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Stage", "Warnings", "Environment", + }); + internal_static_google_cloud_functions_v2_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_functions_v2_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusDetail", + "CancelRequested", + "ApiVersion", + "RequestResource", + "Stages", + }); + internal_static_google_cloud_functions_v2_Stage_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_functions_v2_Stage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2_Stage_descriptor, + new java.lang.String[] { + "Name", "Message", "State", "Resource", "ResourceUri", "StateMessages", + }); + 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.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java new file mode 100644 index 00000000..9dc61434 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java @@ -0,0 +1,660 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.GenerateDownloadUrlRequest} + */ +public final class GenerateDownloadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v2.GenerateDownloadUrlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * 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 function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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.v2.GenerateDownloadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.GenerateDownloadUrlRequest other = + (com.google.cloud.functions.v2.GenerateDownloadUrlRequest) 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.v2.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.GenerateDownloadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.GenerateDownloadUrlRequest) + com.google.cloud.functions.v2.GenerateDownloadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v2.GenerateDownloadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateDownloadUrlRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.GenerateDownloadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateDownloadUrlRequest build() { + com.google.cloud.functions.v2.GenerateDownloadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateDownloadUrlRequest buildPartial() { + com.google.cloud.functions.v2.GenerateDownloadUrlRequest result = + new com.google.cloud.functions.v2.GenerateDownloadUrlRequest(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.v2.GenerateDownloadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v2.GenerateDownloadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.GenerateDownloadUrlRequest other) { + if (other == com.google.cloud.functions.v2.GenerateDownloadUrlRequest.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.v2.GenerateDownloadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.GenerateDownloadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * 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 function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * 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 function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * 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 function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * 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 function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * 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.v2.GenerateDownloadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.GenerateDownloadUrlRequest) + private static final com.google.cloud.functions.v2.GenerateDownloadUrlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.GenerateDownloadUrlRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java new file mode 100644 index 00000000..58c86245 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface GenerateDownloadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.GenerateDownloadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * 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-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponse.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponse.java new file mode 100644 index 00000000..a4602c53 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponse.java @@ -0,0 +1,646 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Response of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.GenerateDownloadUrlResponse} + */ +public final class GenerateDownloadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v2.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(downloadUrl_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(downloadUrl_)) { + 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.v2.GenerateDownloadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.GenerateDownloadUrlResponse other = + (com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.GenerateDownloadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.GenerateDownloadUrlResponse) + com.google.cloud.functions.v2.GenerateDownloadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v2.GenerateDownloadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateDownloadUrlResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2.GenerateDownloadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateDownloadUrlResponse build() { + com.google.cloud.functions.v2.GenerateDownloadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateDownloadUrlResponse buildPartial() { + com.google.cloud.functions.v2.GenerateDownloadUrlResponse result = + new com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v2.GenerateDownloadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.GenerateDownloadUrlResponse other) { + if (other == com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.GenerateDownloadUrlResponse) + private static final com.google.cloud.functions.v2.GenerateDownloadUrlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.GenerateDownloadUrlResponse(); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateDownloadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlResponseOrBuilder.java new file mode 100644 index 00000000..db61c3cc --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface GenerateDownloadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.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-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java new file mode 100644 index 00000000..02345a63 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java @@ -0,0 +1,660 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.GenerateUploadUrlRequest} + */ +public final class GenerateUploadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v2.GenerateUploadUrlRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + 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.v2.GenerateUploadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.GenerateUploadUrlRequest other = + (com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.GenerateUploadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.GenerateUploadUrlRequest) + com.google.cloud.functions.v2.GenerateUploadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v2.GenerateUploadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateUploadUrlRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.GenerateUploadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateUploadUrlRequest build() { + com.google.cloud.functions.v2.GenerateUploadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateUploadUrlRequest buildPartial() { + com.google.cloud.functions.v2.GenerateUploadUrlRequest result = + new com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v2.GenerateUploadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.GenerateUploadUrlRequest other) { + if (other == com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.GenerateUploadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @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.v2.GenerateUploadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.GenerateUploadUrlRequest) + private static final com.google.cloud.functions.v2.GenerateUploadUrlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.GenerateUploadUrlRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java new file mode 100644 index 00000000..d917cd03 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface GenerateUploadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.GenerateUploadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponse.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponse.java new file mode 100644 index 00000000..f7431d3b --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponse.java @@ -0,0 +1,991 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Response of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.GenerateUploadUrlResponse} + */ +public final class GenerateUploadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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; + } + case 18: + { + com.google.cloud.functions.v2.StorageSource.Builder subBuilder = null; + if (storageSource_ != null) { + subBuilder = storageSource_.toBuilder(); + } + storageSource_ = + input.readMessage( + com.google.cloud.functions.v2.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(storageSource_); + storageSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v2.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; + } + } + + public static final int STORAGE_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2.StorageSource storageSource_; + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return storageSource_ != null; + } + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource getStorageSource() { + return storageSource_ == null + ? com.google.cloud.functions.v2.StorageSource.getDefaultInstance() + : storageSource_; + } + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSourceOrBuilder getStorageSourceOrBuilder() { + return getStorageSource(); + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadUrl_); + } + if (storageSource_ != null) { + output.writeMessage(2, getStorageSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadUrl_); + } + if (storageSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStorageSource()); + } + 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.v2.GenerateUploadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.GenerateUploadUrlResponse other = + (com.google.cloud.functions.v2.GenerateUploadUrlResponse) obj; + + if (!getUploadUrl().equals(other.getUploadUrl())) return false; + if (hasStorageSource() != other.hasStorageSource()) return false; + if (hasStorageSource()) { + if (!getStorageSource().equals(other.getStorageSource())) 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(); + if (hasStorageSource()) { + hash = (37 * hash) + STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getStorageSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.GenerateUploadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.GenerateUploadUrlResponse) + com.google.cloud.functions.v2.GenerateUploadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v2.GenerateUploadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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_ = ""; + + if (storageSourceBuilder_ == null) { + storageSource_ = null; + } else { + storageSource_ = null; + storageSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateUploadUrlResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2.GenerateUploadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateUploadUrlResponse build() { + com.google.cloud.functions.v2.GenerateUploadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GenerateUploadUrlResponse buildPartial() { + com.google.cloud.functions.v2.GenerateUploadUrlResponse result = + new com.google.cloud.functions.v2.GenerateUploadUrlResponse(this); + result.uploadUrl_ = uploadUrl_; + if (storageSourceBuilder_ == null) { + result.storageSource_ = storageSource_; + } else { + result.storageSource_ = storageSourceBuilder_.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.v2.GenerateUploadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v2.GenerateUploadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.GenerateUploadUrlResponse other) { + if (other == com.google.cloud.functions.v2.GenerateUploadUrlResponse.getDefaultInstance()) + return this; + if (!other.getUploadUrl().isEmpty()) { + uploadUrl_ = other.uploadUrl_; + onChanged(); + } + if (other.hasStorageSource()) { + mergeStorageSource(other.getStorageSource()); + } + 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.v2.GenerateUploadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.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; + } + + private com.google.cloud.functions.v2.StorageSource storageSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder> + storageSourceBuilder_; + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + public boolean hasStorageSource() { + return storageSourceBuilder_ != null || storageSource_ != null; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + public com.google.cloud.functions.v2.StorageSource getStorageSource() { + if (storageSourceBuilder_ == null) { + return storageSource_ == null + ? com.google.cloud.functions.v2.StorageSource.getDefaultInstance() + : storageSource_; + } else { + return storageSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + public Builder setStorageSource(com.google.cloud.functions.v2.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageSource_ = value; + onChanged(); + } else { + storageSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + public Builder setStorageSource( + com.google.cloud.functions.v2.StorageSource.Builder builderForValue) { + if (storageSourceBuilder_ == null) { + storageSource_ = builderForValue.build(); + onChanged(); + } else { + storageSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + public Builder mergeStorageSource(com.google.cloud.functions.v2.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (storageSource_ != null) { + storageSource_ = + com.google.cloud.functions.v2.StorageSource.newBuilder(storageSource_) + .mergeFrom(value) + .buildPartial(); + } else { + storageSource_ = value; + } + onChanged(); + } else { + storageSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + public Builder clearStorageSource() { + if (storageSourceBuilder_ == null) { + storageSource_ = null; + onChanged(); + } else { + storageSource_ = null; + storageSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + public com.google.cloud.functions.v2.StorageSource.Builder getStorageSourceBuilder() { + + onChanged(); + return getStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + public com.google.cloud.functions.v2.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if (storageSourceBuilder_ != null) { + return storageSourceBuilder_.getMessageOrBuilder(); + } else { + return storageSource_ == null + ? com.google.cloud.functions.v2.StorageSource.getDefaultInstance() + : storageSource_; + } + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder> + getStorageSourceFieldBuilder() { + if (storageSourceBuilder_ == null) { + storageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder>( + getStorageSource(), getParentForChildren(), isClean()); + storageSource_ = null; + } + return storageSourceBuilder_; + } + + @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.v2.GenerateUploadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.GenerateUploadUrlResponse) + private static final com.google.cloud.functions.v2.GenerateUploadUrlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.GenerateUploadUrlResponse(); + } + + public static com.google.cloud.functions.v2.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.v2.GenerateUploadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponseOrBuilder.java new file mode 100644 index 00000000..13799a85 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlResponseOrBuilder.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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface GenerateUploadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.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(); + + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + boolean hasStorageSource(); + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + com.google.cloud.functions.v2.StorageSource getStorageSource(); + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 2; + */ + com.google.cloud.functions.v2.StorageSourceOrBuilder getStorageSourceOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequest.java new file mode 100644 index 00000000..20fd523c --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequest.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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request for the `GetFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.GetFunctionRequest} + */ +public final class GetFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GetFunctionRequest.class, + com.google.cloud.functions.v2.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + 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.v2.GetFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.GetFunctionRequest other = + (com.google.cloud.functions.v2.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.v2.GetFunctionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GetFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.GetFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.GetFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.GetFunctionRequest) + com.google.cloud.functions.v2.GetFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.GetFunctionRequest.class, + com.google.cloud.functions.v2.GetFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_GetFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GetFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.GetFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.GetFunctionRequest build() { + com.google.cloud.functions.v2.GetFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.GetFunctionRequest buildPartial() { + com.google.cloud.functions.v2.GetFunctionRequest result = + new com.google.cloud.functions.v2.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.v2.GetFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2.GetFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.GetFunctionRequest other) { + if (other == com.google.cloud.functions.v2.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.v2.GetFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.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.v2.GetFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.GetFunctionRequest) + private static final com.google.cloud.functions.v2.GetFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.GetFunctionRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.GetFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GetFunctionRequestOrBuilder.java new file mode 100644 index 00000000..d3b18d1d --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface GetFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.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-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java new file mode 100644 index 00000000..ce5a5edb --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java @@ -0,0 +1,1356 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListFunctionsRequest} + */ +public final class ListFunctionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @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; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListFunctionsRequest.class, + com.google.cloud.functions.v2.ListFunctionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of 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; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2.ListFunctionsRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.ListFunctionsRequest other = + (com.google.cloud.functions.v2.ListFunctionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.ListFunctionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.ListFunctionsRequest) + com.google.cloud.functions.v2.ListFunctionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListFunctionsRequest.class, + com.google.cloud.functions.v2.ListFunctionsRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListFunctionsRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.ListFunctionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListFunctionsRequest build() { + com.google.cloud.functions.v2.ListFunctionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListFunctionsRequest buildPartial() { + com.google.cloud.functions.v2.ListFunctionsRequest result = + new com.google.cloud.functions.v2.ListFunctionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2.ListFunctionsRequest) { + return mergeFrom((com.google.cloud.functions.v2.ListFunctionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.ListFunctionsRequest other) { + if (other == com.google.cloud.functions.v2.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(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2.ListFunctionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.ListFunctionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of 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; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2.ListFunctionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.ListFunctionsRequest) + private static final com.google.cloud.functions.v2.ListFunctionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.ListFunctionsRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java new file mode 100644 index 00000000..0e2d1562 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface ListFunctionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.ListFunctionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. 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.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. 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.field_behavior) = REQUIRED, (.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(); + + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponse.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponse.java new file mode 100644 index 00000000..96ed9c91 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponse.java @@ -0,0 +1,1426 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Response for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListFunctionsResponse} + */ +public final class ListFunctionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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.v2.Function.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListFunctionsResponse.class, + com.google.cloud.functions.v2.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.v2.Function functions = 1; + */ + @java.lang.Override + public java.util.List getFunctionsList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + @java.lang.Override + public java.util.List + getFunctionsOrBuilderList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + @java.lang.Override + public int getFunctionsCount() { + return functions_.size(); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.Function getFunctions(int index) { + return functions_.get(index); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.FunctionOrBuilder getFunctionsOrBuilder(int index) { + return functions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + 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.v2.ListFunctionsResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.ListFunctionsResponse other = + (com.google.cloud.functions.v2.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.v2.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.ListFunctionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.ListFunctionsResponse) + com.google.cloud.functions.v2.ListFunctionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListFunctionsResponse.class, + com.google.cloud.functions.v2.ListFunctionsResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListFunctionsResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2.ListFunctionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListFunctionsResponse build() { + com.google.cloud.functions.v2.ListFunctionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListFunctionsResponse buildPartial() { + com.google.cloud.functions.v2.ListFunctionsResponse result = + new com.google.cloud.functions.v2.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.v2.ListFunctionsResponse) { + return mergeFrom((com.google.cloud.functions.v2.ListFunctionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.ListFunctionsResponse other) { + if (other == com.google.cloud.functions.v2.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.v2.ListFunctionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.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.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder> + functionsBuilder_; + + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.Function 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.v2.Function 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.v2.Function functions = 1; + */ + public com.google.cloud.functions.v2.Function 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.v2.Function functions = 1; + */ + public Builder setFunctions(int index, com.google.cloud.functions.v2.Function 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.v2.Function functions = 1; + */ + public Builder setFunctions( + int index, com.google.cloud.functions.v2.Function.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.v2.Function functions = 1; + */ + public Builder addFunctions(com.google.cloud.functions.v2.Function 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.v2.Function functions = 1; + */ + public Builder addFunctions(int index, com.google.cloud.functions.v2.Function 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.v2.Function functions = 1; + */ + public Builder addFunctions(com.google.cloud.functions.v2.Function.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.v2.Function functions = 1; + */ + public Builder addFunctions( + int index, com.google.cloud.functions.v2.Function.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.v2.Function 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.v2.Function 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.v2.Function 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.v2.Function functions = 1; + */ + public com.google.cloud.functions.v2.Function.Builder getFunctionsBuilder(int index) { + return getFunctionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + public com.google.cloud.functions.v2.FunctionOrBuilder 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.v2.Function 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.v2.Function functions = 1; + */ + public com.google.cloud.functions.v2.Function.Builder addFunctionsBuilder() { + return getFunctionsFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.Function.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + public com.google.cloud.functions.v2.Function.Builder addFunctionsBuilder(int index) { + return getFunctionsFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.Function.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + public java.util.List + getFunctionsBuilderList() { + return getFunctionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder> + getFunctionsFieldBuilder() { + if (functionsBuilder_ == null) { + functionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder>( + functions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + functions_ = null; + } + return functionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * 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.v2.ListFunctionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.ListFunctionsResponse) + private static final com.google.cloud.functions.v2.ListFunctionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.ListFunctionsResponse(); + } + + public static com.google.cloud.functions.v2.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.v2.ListFunctionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponseOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponseOrBuilder.java new file mode 100644 index 00000000..7739bb6b --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsResponseOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface ListFunctionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.ListFunctionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + java.util.List getFunctionsList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + com.google.cloud.functions.v2.Function getFunctions(int index); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + int getFunctionsCount(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + java.util.List + getFunctionsOrBuilderList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.Function functions = 1; + */ + com.google.cloud.functions.v2.FunctionOrBuilder getFunctionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * 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-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java new file mode 100644 index 00000000..4891d75b --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java @@ -0,0 +1,845 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request for the `ListRuntimes` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListRuntimesRequest} + */ +public final class ListRuntimesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.ListRuntimesRequest) + ListRuntimesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimesRequest.newBuilder() to construct. + private ListRuntimesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimesRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListRuntimesRequest.class, + com.google.cloud.functions.v2.ListRuntimesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + 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.v2.ListRuntimesRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.ListRuntimesRequest other = + (com.google.cloud.functions.v2.ListRuntimesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) 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) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest 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.v2.ListRuntimesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest 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.v2.ListRuntimesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest 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.v2.ListRuntimesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest 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.v2.ListRuntimesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest 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.v2.ListRuntimesRequest 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 `ListRuntimes` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListRuntimesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.ListRuntimesRequest) + com.google.cloud.functions.v2.ListRuntimesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListRuntimesRequest.class, + com.google.cloud.functions.v2.ListRuntimesRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.ListRuntimesRequest.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_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.ListRuntimesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesRequest build() { + com.google.cloud.functions.v2.ListRuntimesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesRequest buildPartial() { + com.google.cloud.functions.v2.ListRuntimesRequest result = + new com.google.cloud.functions.v2.ListRuntimesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + 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.v2.ListRuntimesRequest) { + return mergeFrom((com.google.cloud.functions.v2.ListRuntimesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.ListRuntimesRequest other) { + if (other == com.google.cloud.functions.v2.ListRuntimesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.v2.ListRuntimesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.ListRuntimesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @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.v2.ListRuntimesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.ListRuntimesRequest) + private static final com.google.cloud.functions.v2.ListRuntimesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.ListRuntimesRequest(); + } + + public static com.google.cloud.functions.v2.ListRuntimesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimesRequest(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.v2.ListRuntimesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java new file mode 100644 index 00000000..77c9fd7d --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface ListRuntimesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.ListRuntimesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponse.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponse.java new file mode 100644 index 00000000..653df859 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponse.java @@ -0,0 +1,2778 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Response for the `ListRuntimes` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListRuntimesResponse} + */ +public final class ListRuntimesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.ListRuntimesResponse) + ListRuntimesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimesResponse.newBuilder() to construct. + private ListRuntimesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimesResponse() { + runtimes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimesResponse( + 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)) { + runtimes_ = + new java.util.ArrayList< + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime>(); + mutable_bitField0_ |= 0x00000001; + } + runtimes_.add( + input.readMessage( + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + runtimes_ = java.util.Collections.unmodifiableList(runtimes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListRuntimesResponse.class, + com.google.cloud.functions.v2.ListRuntimesResponse.Builder.class); + } + + /** + * + * + *
+   * The various stages that a runtime can be in.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage} + */ + public enum RuntimeStage implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RUNTIME_STAGE_UNSPECIFIED = 0; + */ + RUNTIME_STAGE_UNSPECIFIED(0), + /** + * + * + *
+     * The runtime is in development.
+     * 
+ * + * DEVELOPMENT = 1; + */ + DEVELOPMENT(1), + /** + * + * + *
+     * The runtime is in the Alpha stage.
+     * 
+ * + * ALPHA = 2; + */ + ALPHA(2), + /** + * + * + *
+     * The runtime is in the Beta stage.
+     * 
+ * + * BETA = 3; + */ + BETA(3), + /** + * + * + *
+     * The runtime is generally available.
+     * 
+ * + * GA = 4; + */ + GA(4), + /** + * + * + *
+     * The runtime is deprecated.
+     * 
+ * + * DEPRECATED = 5; + */ + DEPRECATED(5), + /** + * + * + *
+     * The runtime is no longer supported.
+     * 
+ * + * DECOMMISSIONED = 6; + */ + DECOMMISSIONED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RUNTIME_STAGE_UNSPECIFIED = 0; + */ + public static final int RUNTIME_STAGE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The runtime is in development.
+     * 
+ * + * DEVELOPMENT = 1; + */ + public static final int DEVELOPMENT_VALUE = 1; + /** + * + * + *
+     * The runtime is in the Alpha stage.
+     * 
+ * + * ALPHA = 2; + */ + public static final int ALPHA_VALUE = 2; + /** + * + * + *
+     * The runtime is in the Beta stage.
+     * 
+ * + * BETA = 3; + */ + public static final int BETA_VALUE = 3; + /** + * + * + *
+     * The runtime is generally available.
+     * 
+ * + * GA = 4; + */ + public static final int GA_VALUE = 4; + /** + * + * + *
+     * The runtime is deprecated.
+     * 
+ * + * DEPRECATED = 5; + */ + public static final int DEPRECATED_VALUE = 5; + /** + * + * + *
+     * The runtime is no longer supported.
+     * 
+ * + * DECOMMISSIONED = 6; + */ + public static final int DECOMMISSIONED_VALUE = 6; + + 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 RuntimeStage 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 RuntimeStage forNumber(int value) { + switch (value) { + case 0: + return RUNTIME_STAGE_UNSPECIFIED; + case 1: + return DEVELOPMENT; + case 2: + return ALPHA; + case 3: + return BETA; + case 4: + return GA; + case 5: + return DEPRECATED; + case 6: + return DECOMMISSIONED; + 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 RuntimeStage findValueByNumber(int number) { + return RuntimeStage.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.v2.ListRuntimesResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RuntimeStage[] VALUES = values(); + + public static RuntimeStage 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 RuntimeStage(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage) + } + + public interface RuntimeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.ListRuntimesResponse.Runtime) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + int getStageValue(); + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage getStage(); + + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + java.util.List getWarningsList(); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + int getWarningsCount(); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + java.lang.String getWarnings(int index); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + com.google.protobuf.ByteString getWarningsBytes(int index); + + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + int getEnvironmentValue(); + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return The environment. + */ + com.google.cloud.functions.v2.Environment getEnvironment(); + } + /** + * + * + *
+   * Describes a runtime and any special information (e.g., deprecation status)
+   * related to it.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListRuntimesResponse.Runtime} + */ + public static final class Runtime extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.ListRuntimesResponse.Runtime) + RuntimeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Runtime.newBuilder() to construct. + private Runtime(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Runtime() { + name_ = ""; + displayName_ = ""; + stage_ = 0; + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + environment_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Runtime(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Runtime( + 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 16: + { + int rawValue = input.readEnum(); + + stage_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + warnings_.add(s); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + environment_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.class, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * 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 the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * 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 DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STAGE_FIELD_NUMBER = 2; + private int stage_; + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage getStage() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage result = + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage.valueOf(stage_); + return result == null + ? com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage.UNRECOGNIZED + : result; + } + + public static final int WARNINGS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList warnings_; + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_; + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 4; + private int environment_; + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Environment result = + com.google.cloud.functions.v2.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2.Environment.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (stage_ + != com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage + .RUNTIME_STAGE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, stage_); + } + for (int i = 0; i < warnings_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, warnings_.getRaw(i)); + } + if (environment_ + != com.google.cloud.functions.v2.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + output.writeEnum(4, environment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (stage_ + != com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage + .RUNTIME_STAGE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stage_); + } + { + int dataSize = 0; + for (int i = 0; i < warnings_.size(); i++) { + dataSize += computeStringSizeNoTag(warnings_.getRaw(i)); + } + size += dataSize; + size += 1 * getWarningsList().size(); + } + if (environment_ + != com.google.cloud.functions.v2.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, environment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + 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.v2.ListRuntimesResponse.Runtime)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime other = + (com.google.cloud.functions.v2.ListRuntimesResponse.Runtime) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (stage_ != other.stage_) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (environment_ != other.environment_) 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STAGE_FIELD_NUMBER; + hash = (53 * hash) + stage_; + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + environment_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime 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.v2.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime 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.v2.ListRuntimesResponse.Runtime parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime 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.v2.ListRuntimesResponse.Runtime parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime 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.v2.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime 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.v2.ListRuntimesResponse.Runtime 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 runtime and any special information (e.g., deprecation status)
+     * related to it.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListRuntimesResponse.Runtime} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.ListRuntimesResponse.Runtime) + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.class, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.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_ = ""; + + displayName_ = ""; + + stage_ = 0; + + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + environment_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime + getDefaultInstanceForType() { + return com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime build() { + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime buildPartial() { + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime result = + new com.google.cloud.functions.v2.ListRuntimesResponse.Runtime(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.stage_ = stage_; + if (((bitField0_ & 0x00000001) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.warnings_ = warnings_; + result.environment_ = environment_; + 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.v2.ListRuntimesResponse.Runtime) { + return mergeFrom((com.google.cloud.functions.v2.ListRuntimesResponse.Runtime) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.ListRuntimesResponse.Runtime other) { + if (other + == com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.stage_ != 0) { + setStageValue(other.getStageValue()); + } + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + if (other.environment_ != 0) { + setEnvironmentValue(other.getEnvironmentValue()); + } + 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.v2.ListRuntimesResponse.Runtime parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.ListRuntimesResponse.Runtime) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * 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 the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * 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 the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * 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 the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * 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 displayName_ = ""; + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int stage_ = 0; + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @param value The enum numeric value on the wire for stage to set. + * @return This builder for chaining. + */ + public Builder setStageValue(int value) { + + stage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage getStage() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage result = + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage.valueOf(stage_); + return result == null + ? com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @param value The stage to set. + * @return This builder for chaining. + */ + public Builder setStage( + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage value) { + if (value == null) { + throw new NullPointerException(); + } + + stage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return This builder for chaining. + */ + public Builder clearStage() { + + stage_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList warnings_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(warnings_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_.getUnmodifiableView(); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index to set the value at. + * @param value The warnings to set. + * @return This builder for chaining. + */ + public Builder setWarnings(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param value The warnings to add. + * @return This builder for chaining. + */ + public Builder addWarnings(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param values The warnings to add. + * @return This builder for chaining. + */ + public Builder addAllWarnings(java.lang.Iterable values) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return This builder for chaining. + */ + public Builder clearWarnings() { + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param value The bytes of the warnings to add. + * @return This builder for chaining. + */ + public Builder addWarningsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + + private int environment_ = 0; + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @param value The enum numeric value on the wire for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentValue(int value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Environment result = + com.google.cloud.functions.v2.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2.Environment.UNRECOGNIZED : result; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(com.google.cloud.functions.v2.Environment value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2.Environment environment = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2.ListRuntimesResponse.Runtime) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.ListRuntimesResponse.Runtime) + private static final com.google.cloud.functions.v2.ListRuntimesResponse.Runtime + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.ListRuntimesResponse.Runtime(); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse.Runtime getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Runtime parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Runtime(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.v2.ListRuntimesResponse.Runtime getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RUNTIMES_FIELD_NUMBER = 1; + private java.util.List runtimes_; + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public java.util.List + getRuntimesList() { + return runtimes_; + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesOrBuilderList() { + return runtimes_; + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public int getRuntimesCount() { + return runtimes_.size(); + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime getRuntimes(int index) { + return runtimes_.get(index); + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder getRuntimesOrBuilder( + int index) { + return runtimes_.get(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 < runtimes_.size(); i++) { + output.writeMessage(1, runtimes_.get(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 < runtimes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, runtimes_.get(i)); + } + 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.v2.ListRuntimesResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.ListRuntimesResponse other = + (com.google.cloud.functions.v2.ListRuntimesResponse) obj; + + if (!getRuntimesList().equals(other.getRuntimesList())) 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 (getRuntimesCount() > 0) { + hash = (37 * hash) + RUNTIMES_FIELD_NUMBER; + hash = (53 * hash) + getRuntimesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse 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.v2.ListRuntimesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse 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.v2.ListRuntimesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse 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.v2.ListRuntimesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse 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.v2.ListRuntimesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse 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.v2.ListRuntimesResponse 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 `ListRuntimes` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ListRuntimesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.ListRuntimesResponse) + com.google.cloud.functions.v2.ListRuntimesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ListRuntimesResponse.class, + com.google.cloud.functions.v2.ListRuntimesResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.ListRuntimesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuntimesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (runtimesBuilder_ == null) { + runtimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + runtimesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2.ListRuntimesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse build() { + com.google.cloud.functions.v2.ListRuntimesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ListRuntimesResponse buildPartial() { + com.google.cloud.functions.v2.ListRuntimesResponse result = + new com.google.cloud.functions.v2.ListRuntimesResponse(this); + int from_bitField0_ = bitField0_; + if (runtimesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + runtimes_ = java.util.Collections.unmodifiableList(runtimes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.runtimes_ = runtimes_; + } else { + result.runtimes_ = runtimesBuilder_.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.v2.ListRuntimesResponse) { + return mergeFrom((com.google.cloud.functions.v2.ListRuntimesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.ListRuntimesResponse other) { + if (other == com.google.cloud.functions.v2.ListRuntimesResponse.getDefaultInstance()) + return this; + if (runtimesBuilder_ == null) { + if (!other.runtimes_.isEmpty()) { + if (runtimes_.isEmpty()) { + runtimes_ = other.runtimes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuntimesIsMutable(); + runtimes_.addAll(other.runtimes_); + } + onChanged(); + } + } else { + if (!other.runtimes_.isEmpty()) { + if (runtimesBuilder_.isEmpty()) { + runtimesBuilder_.dispose(); + runtimesBuilder_ = null; + runtimes_ = other.runtimes_; + bitField0_ = (bitField0_ & ~0x00000001); + runtimesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuntimesFieldBuilder() + : null; + } else { + runtimesBuilder_.addAllMessages(other.runtimes_); + } + } + } + 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.v2.ListRuntimesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.ListRuntimesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List runtimes_ = + java.util.Collections.emptyList(); + + private void ensureRuntimesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + runtimes_ = + new java.util.ArrayList( + runtimes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder> + runtimesBuilder_; + + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public java.util.List + getRuntimesList() { + if (runtimesBuilder_ == null) { + return java.util.Collections.unmodifiableList(runtimes_); + } else { + return runtimesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public int getRuntimesCount() { + if (runtimesBuilder_ == null) { + return runtimes_.size(); + } else { + return runtimesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime getRuntimes(int index) { + if (runtimesBuilder_ == null) { + return runtimes_.get(index); + } else { + return runtimesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder setRuntimes( + int index, com.google.cloud.functions.v2.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.set(index, value); + onChanged(); + } else { + runtimesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder setRuntimes( + int index, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.set(index, builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder addRuntimes(com.google.cloud.functions.v2.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.add(value); + onChanged(); + } else { + runtimesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder addRuntimes( + int index, com.google.cloud.functions.v2.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.add(index, value); + onChanged(); + } else { + runtimesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder addRuntimes( + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.add(builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder addRuntimes( + int index, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.add(index, builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder addAllRuntimes( + java.lang.Iterable + values) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, runtimes_); + onChanged(); + } else { + runtimesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder clearRuntimes() { + if (runtimesBuilder_ == null) { + runtimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + runtimesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public Builder removeRuntimes(int index) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.remove(index); + onChanged(); + } else { + runtimesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder getRuntimesBuilder( + int index) { + return getRuntimesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder getRuntimesOrBuilder( + int index) { + if (runtimesBuilder_ == null) { + return runtimes_.get(index); + } else { + return runtimesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public java.util.List< + ? extends com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesOrBuilderList() { + if (runtimesBuilder_ != null) { + return runtimesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(runtimes_); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder addRuntimesBuilder() { + return getRuntimesFieldBuilder() + .addBuilder( + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.getDefaultInstance()); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder addRuntimesBuilder( + int index) { + return getRuntimesFieldBuilder() + .addBuilder( + index, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.getDefaultInstance()); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + public java.util.List + getRuntimesBuilderList() { + return getRuntimesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesFieldBuilder() { + if (runtimesBuilder_ == null) { + runtimesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder>( + runtimes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + runtimes_ = null; + } + return runtimesBuilder_; + } + + @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.v2.ListRuntimesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.ListRuntimesResponse) + private static final com.google.cloud.functions.v2.ListRuntimesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.ListRuntimesResponse(); + } + + public static com.google.cloud.functions.v2.ListRuntimesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimesResponse(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.v2.ListRuntimesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponseOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponseOrBuilder.java new file mode 100644 index 00000000..c4cf85c8 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesResponseOrBuilder.java @@ -0,0 +1,78 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface ListRuntimesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.ListRuntimesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + java.util.List getRuntimesList(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + com.google.cloud.functions.v2.ListRuntimesResponse.Runtime getRuntimes(int index); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + int getRuntimesCount(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + java.util.List + getRuntimesOrBuilderList(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2.ListRuntimesResponse.Runtime runtimes = 1; + */ + com.google.cloud.functions.v2.ListRuntimesResponse.RuntimeOrBuilder getRuntimesOrBuilder( + int index); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/LocationName.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/LocationName.java new file mode 100644 index 00000000..ddde5a40 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 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.v2; + +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + 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 = + PROJECT_LOCATION.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 PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + 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(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java new file mode 100644 index 00000000..23355e25 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java @@ -0,0 +1,2581 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + stages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: + { + cancelRequested_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + case 66: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (requestResource_ != null) { + subBuilder = requestResource_.toBuilder(); + } + requestResource_ = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestResource_); + requestResource_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stages_.add( + input.readMessage( + com.google.cloud.functions.v2.Stage.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stages_ = java.util.Collections.unmodifiableList(stages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.OperationMetadata.class, + com.google.cloud.functions.v2.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + 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(); + statusDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + * + * + *
+   * Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_RESOURCE_FIELD_NUMBER = 8; + private com.google.protobuf.Any requestResource_; + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + @java.lang.Override + public boolean hasRequestResource() { + return requestResource_ != null; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + @java.lang.Override + public com.google.protobuf.Any getRequestResource() { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder() { + return getRequestResource(); + } + + public static final int STAGES_FIELD_NUMBER = 9; + private java.util.List stages_; + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + @java.lang.Override + public java.util.List getStagesList() { + return stages_; + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + @java.lang.Override + public java.util.List + getStagesOrBuilderList() { + return stages_; + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + @java.lang.Override + public int getStagesCount() { + return stages_.size(); + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + @java.lang.Override + public com.google.cloud.functions.v2.Stage getStages(int index) { + return stages_.get(index); + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StageOrBuilder getStagesOrBuilder(int index) { + return stages_.get(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 { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + if (requestResource_ != null) { + output.writeMessage(8, getRequestResource()); + } + for (int i = 0; i < stages_.size(); i++) { + output.writeMessage(9, stages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + if (requestResource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getRequestResource()); + } + for (int i = 0; i < stages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, stages_.get(i)); + } + 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.v2.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.OperationMetadata other = + (com.google.cloud.functions.v2.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusDetail().equals(other.getStatusDetail())) return false; + if (getCancelRequested() != other.getCancelRequested()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (hasRequestResource() != other.hasRequestResource()) return false; + if (hasRequestResource()) { + if (!getRequestResource().equals(other.getRequestResource())) return false; + } + if (!getStagesList().equals(other.getStagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + if (hasRequestResource()) { + hash = (37 * hash) + REQUEST_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRequestResource().hashCode(); + } + if (getStagesCount() > 0) { + hash = (37 * hash) + STAGES_FIELD_NUMBER; + hash = (53 * hash) + getStagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.OperationMetadata) + com.google.cloud.functions.v2.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.OperationMetadata.class, + com.google.cloud.functions.v2.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + if (requestResourceBuilder_ == null) { + requestResource_ = null; + } else { + requestResource_ = null; + requestResourceBuilder_ = null; + } + if (stagesBuilder_ == null) { + stages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + stagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.functions.v2.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.OperationMetadata build() { + com.google.cloud.functions.v2.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.OperationMetadata buildPartial() { + com.google.cloud.functions.v2.OperationMetadata result = + new com.google.cloud.functions.v2.OperationMetadata(this); + int from_bitField0_ = bitField0_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + if (requestResourceBuilder_ == null) { + result.requestResource_ = requestResource_; + } else { + result.requestResource_ = requestResourceBuilder_.build(); + } + if (stagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stages_ = java.util.Collections.unmodifiableList(stages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stages_ = stages_; + } else { + result.stages_ = stagesBuilder_.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.v2.OperationMetadata) { + return mergeFrom((com.google.cloud.functions.v2.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.OperationMetadata other) { + if (other == com.google.cloud.functions.v2.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + if (other.hasRequestResource()) { + mergeRequestResource(other.getRequestResource()); + } + if (stagesBuilder_ == null) { + if (!other.stages_.isEmpty()) { + if (stages_.isEmpty()) { + stages_ = other.stages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStagesIsMutable(); + stages_.addAll(other.stages_); + } + onChanged(); + } + } else { + if (!other.stages_.isEmpty()) { + if (stagesBuilder_.isEmpty()) { + stagesBuilder_.dispose(); + stagesBuilder_ = null; + stages_ = other.stages_; + bitField0_ = (bitField0_ & ~0x00000001); + stagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStagesFieldBuilder() + : null; + } else { + stagesBuilder_.addAllMessages(other.stages_); + } + } + } + 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.v2.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_; + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any requestResource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + requestResourceBuilder_; + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + public boolean hasRequestResource() { + return requestResourceBuilder_ != null || requestResource_ != null; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + public com.google.protobuf.Any getRequestResource() { + if (requestResourceBuilder_ == null) { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } else { + return requestResourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder setRequestResource(com.google.protobuf.Any value) { + if (requestResourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestResource_ = value; + onChanged(); + } else { + requestResourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder setRequestResource(com.google.protobuf.Any.Builder builderForValue) { + if (requestResourceBuilder_ == null) { + requestResource_ = builderForValue.build(); + onChanged(); + } else { + requestResourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder mergeRequestResource(com.google.protobuf.Any value) { + if (requestResourceBuilder_ == null) { + if (requestResource_ != null) { + requestResource_ = + com.google.protobuf.Any.newBuilder(requestResource_).mergeFrom(value).buildPartial(); + } else { + requestResource_ = value; + } + onChanged(); + } else { + requestResourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder clearRequestResource() { + if (requestResourceBuilder_ == null) { + requestResource_ = null; + onChanged(); + } else { + requestResource_ = null; + requestResourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public com.google.protobuf.Any.Builder getRequestResourceBuilder() { + + onChanged(); + return getRequestResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder() { + if (requestResourceBuilder_ != null) { + return requestResourceBuilder_.getMessageOrBuilder(); + } else { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getRequestResourceFieldBuilder() { + if (requestResourceBuilder_ == null) { + requestResourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + getRequestResource(), getParentForChildren(), isClean()); + requestResource_ = null; + } + return requestResourceBuilder_; + } + + private java.util.List stages_ = + java.util.Collections.emptyList(); + + private void ensureStagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stages_ = new java.util.ArrayList(stages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.Stage, + com.google.cloud.functions.v2.Stage.Builder, + com.google.cloud.functions.v2.StageOrBuilder> + stagesBuilder_; + + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public java.util.List getStagesList() { + if (stagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stages_); + } else { + return stagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public int getStagesCount() { + if (stagesBuilder_ == null) { + return stages_.size(); + } else { + return stagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public com.google.cloud.functions.v2.Stage getStages(int index) { + if (stagesBuilder_ == null) { + return stages_.get(index); + } else { + return stagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder setStages(int index, com.google.cloud.functions.v2.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.set(index, value); + onChanged(); + } else { + stagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder setStages( + int index, com.google.cloud.functions.v2.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.set(index, builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder addStages(com.google.cloud.functions.v2.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.add(value); + onChanged(); + } else { + stagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder addStages(int index, com.google.cloud.functions.v2.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.add(index, value); + onChanged(); + } else { + stagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder addStages(com.google.cloud.functions.v2.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.add(builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder addStages( + int index, com.google.cloud.functions.v2.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.add(index, builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder addAllStages( + java.lang.Iterable values) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stages_); + onChanged(); + } else { + stagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder clearStages() { + if (stagesBuilder_ == null) { + stages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public Builder removeStages(int index) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.remove(index); + onChanged(); + } else { + stagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public com.google.cloud.functions.v2.Stage.Builder getStagesBuilder(int index) { + return getStagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public com.google.cloud.functions.v2.StageOrBuilder getStagesOrBuilder(int index) { + if (stagesBuilder_ == null) { + return stages_.get(index); + } else { + return stagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public java.util.List + getStagesOrBuilderList() { + if (stagesBuilder_ != null) { + return stagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stages_); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public com.google.cloud.functions.v2.Stage.Builder addStagesBuilder() { + return getStagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.Stage.getDefaultInstance()); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public com.google.cloud.functions.v2.Stage.Builder addStagesBuilder(int index) { + return getStagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.Stage.getDefaultInstance()); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + public java.util.List getStagesBuilderList() { + return getStagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.Stage, + com.google.cloud.functions.v2.Stage.Builder, + com.google.cloud.functions.v2.StageOrBuilder> + getStagesFieldBuilder() { + if (stagesBuilder_ == null) { + stagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.Stage, + com.google.cloud.functions.v2.Stage.Builder, + com.google.cloud.functions.v2.StageOrBuilder>( + stages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + stages_ = null; + } + return stagesBuilder_; + } + + @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.v2.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.OperationMetadata) + private static final com.google.cloud.functions.v2.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.OperationMetadata(); + } + + public static com.google.cloud.functions.v2.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..0eb1ed75 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java @@ -0,0 +1,297 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString getStatusDetailBytes(); + + /** + * + * + *
+   * Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + boolean hasRequestResource(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + com.google.protobuf.Any getRequestResource(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder(); + + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + java.util.List getStagesList(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + com.google.cloud.functions.v2.Stage getStages(int index); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + int getStagesCount(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + java.util.List getStagesOrBuilderList(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2.Stage stages = 9; + */ + com.google.cloud.functions.v2.StageOrBuilder getStagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSource.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSource.java new file mode 100644 index 00000000..9990454c --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSource.java @@ -0,0 +1,1935 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Location of the source in a Google Cloud Source Repository.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.RepoSource} + */ +public final class RepoSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.RepoSource) + RepoSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use RepoSource.newBuilder() to construct. + private RepoSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepoSource() { + projectId_ = ""; + repoName_ = ""; + dir_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepoSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RepoSource( + 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(); + + projectId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + repoName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 3; + revision_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 4; + revision_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 5; + revision_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + dir_ = s; + break; + } + case 56: + { + invertRegex_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_RepoSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_RepoSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.RepoSource.class, + com.google.cloud.functions.v2.RepoSource.Builder.class); + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + + public enum RevisionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BRANCH_NAME(3), + TAG_NAME(4), + COMMIT_SHA(5), + REVISION_NOT_SET(0); + private final int value; + + private RevisionCase(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 RevisionCase valueOf(int value) { + return forNumber(value); + } + + public static RevisionCase forNumber(int value) { + switch (value) { + case 3: + return BRANCH_NAME; + case 4: + return TAG_NAME; + case 5: + return COMMIT_SHA; + case 0: + return REVISION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RevisionCase getRevisionCase() { + return RevisionCase.forNumber(revisionCase_); + } + + public static final int BRANCH_NAME_FIELD_NUMBER = 3; + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + public boolean hasBranchName() { + return revisionCase_ == 3; + } + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + public java.lang.String getBranchName() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + 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 (revisionCase_ == 3) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + public com.google.protobuf.ByteString getBranchNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAG_NAME_FIELD_NUMBER = 4; + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + public boolean hasTagName() { + return revisionCase_ == 4; + } + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + public java.lang.String getTagName() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + 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 (revisionCase_ == 4) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + public com.google.protobuf.ByteString getTagNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 4) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMIT_SHA_FIELD_NUMBER = 5; + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + public boolean hasCommitSha() { + return revisionCase_ == 5; + } + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + public java.lang.String getCommitSha() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + 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 (revisionCase_ == 5) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + public com.google.protobuf.ByteString getCommitShaBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 5) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPO_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object repoName_; + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + @java.lang.Override + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + 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(); + repoName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIR_FIELD_NUMBER = 6; + private volatile java.lang.Object dir_; + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The dir. + */ + @java.lang.Override + public java.lang.String getDir() { + java.lang.Object ref = dir_; + 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(); + dir_ = s; + return s; + } + } + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INVERT_REGEX_FIELD_NUMBER = 7; + private boolean invertRegex_; + /** + * + * + *
+   * Only trigger a build if the revision regex does NOT match the revision
+   * regex.
+   * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + @java.lang.Override + public boolean getInvertRegex() { + return invertRegex_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repoName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, repoName_); + } + if (revisionCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revision_); + } + if (revisionCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, revision_); + } + if (revisionCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, revision_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dir_); + } + if (invertRegex_ != false) { + output.writeBool(7, invertRegex_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repoName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, repoName_); + } + if (revisionCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revision_); + } + if (revisionCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, revision_); + } + if (revisionCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, revision_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dir_); + } + if (invertRegex_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, invertRegex_); + } + 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.v2.RepoSource)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.RepoSource other = (com.google.cloud.functions.v2.RepoSource) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getRepoName().equals(other.getRepoName())) return false; + if (!getDir().equals(other.getDir())) return false; + if (getInvertRegex() != other.getInvertRegex()) return false; + if (!getRevisionCase().equals(other.getRevisionCase())) return false; + switch (revisionCase_) { + case 3: + if (!getBranchName().equals(other.getBranchName())) return false; + break; + case 4: + if (!getTagName().equals(other.getTagName())) return false; + break; + case 5: + if (!getCommitSha().equals(other.getCommitSha())) 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) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + REPO_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRepoName().hashCode(); + hash = (37 * hash) + DIR_FIELD_NUMBER; + hash = (53 * hash) + getDir().hashCode(); + hash = (37 * hash) + INVERT_REGEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInvertRegex()); + switch (revisionCase_) { + case 3: + hash = (37 * hash) + BRANCH_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBranchName().hashCode(); + break; + case 4: + hash = (37 * hash) + TAG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTagName().hashCode(); + break; + case 5: + hash = (37 * hash) + COMMIT_SHA_FIELD_NUMBER; + hash = (53 * hash) + getCommitSha().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.RepoSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.RepoSource 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.v2.RepoSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.RepoSource 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.v2.RepoSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.RepoSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.RepoSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.RepoSource 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.v2.RepoSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.RepoSource 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.v2.RepoSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.RepoSource 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.v2.RepoSource 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; + } + /** + * + * + *
+   * Location of the source in a Google Cloud Source Repository.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.RepoSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.RepoSource) + com.google.cloud.functions.v2.RepoSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_RepoSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_RepoSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.RepoSource.class, + com.google.cloud.functions.v2.RepoSource.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.RepoSource.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(); + projectId_ = ""; + + repoName_ = ""; + + dir_ = ""; + + invertRegex_ = false; + + revisionCase_ = 0; + revision_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_RepoSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.RepoSource getDefaultInstanceForType() { + return com.google.cloud.functions.v2.RepoSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.RepoSource build() { + com.google.cloud.functions.v2.RepoSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.RepoSource buildPartial() { + com.google.cloud.functions.v2.RepoSource result = + new com.google.cloud.functions.v2.RepoSource(this); + if (revisionCase_ == 3) { + result.revision_ = revision_; + } + if (revisionCase_ == 4) { + result.revision_ = revision_; + } + if (revisionCase_ == 5) { + result.revision_ = revision_; + } + result.projectId_ = projectId_; + result.repoName_ = repoName_; + result.dir_ = dir_; + result.invertRegex_ = invertRegex_; + result.revisionCase_ = revisionCase_; + 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.v2.RepoSource) { + return mergeFrom((com.google.cloud.functions.v2.RepoSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.RepoSource other) { + if (other == com.google.cloud.functions.v2.RepoSource.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getRepoName().isEmpty()) { + repoName_ = other.repoName_; + onChanged(); + } + if (!other.getDir().isEmpty()) { + dir_ = other.dir_; + onChanged(); + } + if (other.getInvertRegex() != false) { + setInvertRegex(other.getInvertRegex()); + } + switch (other.getRevisionCase()) { + case BRANCH_NAME: + { + revisionCase_ = 3; + revision_ = other.revision_; + onChanged(); + break; + } + case TAG_NAME: + { + revisionCase_ = 4; + revision_ = other.revision_; + onChanged(); + break; + } + case COMMIT_SHA: + { + revisionCase_ = 5; + revision_ = other.revision_; + onChanged(); + break; + } + case REVISION_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.v2.RepoSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.RepoSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + + public RevisionCase getRevisionCase() { + return RevisionCase.forNumber(revisionCase_); + } + + public Builder clearRevision() { + revisionCase_ = 0; + revision_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + @java.lang.Override + public boolean hasBranchName() { + return revisionCase_ == 3; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + @java.lang.Override + public java.lang.String getBranchName() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @param value The branchName to set. + * @return This builder for chaining. + */ + public Builder setBranchName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearBranchName() { + if (revisionCase_ == 3) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @param value The bytes for branchName to set. + * @return This builder for chaining. + */ + public Builder setBranchNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + @java.lang.Override + public boolean hasTagName() { + return revisionCase_ == 4; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + @java.lang.Override + public java.lang.String getTagName() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 4) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 4) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @param value The tagName to set. + * @return This builder for chaining. + */ + public Builder setTagName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 4; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearTagName() { + if (revisionCase_ == 4) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @param value The bytes for tagName to set. + * @return This builder for chaining. + */ + public Builder setTagNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 4; + revision_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + @java.lang.Override + public boolean hasCommitSha() { + return revisionCase_ == 5; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + @java.lang.Override + public java.lang.String getCommitSha() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 5) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommitShaBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 5) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @param value The commitSha to set. + * @return This builder for chaining. + */ + public Builder setCommitSha(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 5; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return This builder for chaining. + */ + public Builder clearCommitSha() { + if (revisionCase_ == 5) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @param value The bytes for commitSha to set. + * @return This builder for chaining. + */ + public Builder setCommitShaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 5; + revision_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object repoName_ = ""; + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + public com.google.protobuf.ByteString getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @param value The repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repoName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearRepoName() { + + repoName_ = getDefaultInstance().getRepoName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @param value The bytes for repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repoName_ = value; + onChanged(); + return this; + } + + private java.lang.Object dir_ = ""; + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return The dir. + */ + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @param value The dir to set. + * @return This builder for chaining. + */ + public Builder setDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dir_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return This builder for chaining. + */ + public Builder clearDir() { + + dir_ = getDefaultInstance().getDir(); + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @param value The bytes for dir to set. + * @return This builder for chaining. + */ + public Builder setDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dir_ = value; + onChanged(); + return this; + } + + private boolean invertRegex_; + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + @java.lang.Override + public boolean getInvertRegex() { + return invertRegex_; + } + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @param value The invertRegex to set. + * @return This builder for chaining. + */ + public Builder setInvertRegex(boolean value) { + + invertRegex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @return This builder for chaining. + */ + public Builder clearInvertRegex() { + + invertRegex_ = false; + 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.v2.RepoSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.RepoSource) + private static final com.google.cloud.functions.v2.RepoSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.RepoSource(); + } + + public static com.google.cloud.functions.v2.RepoSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepoSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepoSource(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.v2.RepoSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSourceOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSourceOrBuilder.java new file mode 100644 index 00000000..efda836b --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/RepoSourceOrBuilder.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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface RepoSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.RepoSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + boolean hasBranchName(); + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + java.lang.String getBranchName(); + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + com.google.protobuf.ByteString getBranchNameBytes(); + + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + boolean hasTagName(); + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + java.lang.String getTagName(); + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + com.google.protobuf.ByteString getTagNameBytes(); + + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + boolean hasCommitSha(); + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + java.lang.String getCommitSha(); + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + com.google.protobuf.ByteString getCommitShaBytes(); + + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + java.lang.String getRepoName(); + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + com.google.protobuf.ByteString getRepoNameBytes(); + + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The dir. + */ + java.lang.String getDir(); + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + com.google.protobuf.ByteString getDirBytes(); + + /** + * + * + *
+   * Only trigger a build if the revision regex does NOT match the revision
+   * regex.
+   * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + boolean getInvertRegex(); + + public com.google.cloud.functions.v2.RepoSource.RevisionCase getRevisionCase(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVar.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVar.java new file mode 100644 index 00000000..1a2e2da6 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVar.java @@ -0,0 +1,1212 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Configuration for a secret environment variable. It has the information
+ * necessary to fetch the secret value from secret manager and expose it as an
+ * environment variable.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SecretEnvVar} + */ +public final class SecretEnvVar extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.SecretEnvVar) + SecretEnvVarOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretEnvVar.newBuilder() to construct. + private SecretEnvVar(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretEnvVar() { + key_ = ""; + projectId_ = ""; + secret_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretEnvVar(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretEnvVar( + 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(); + + key_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + secret_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretEnvVar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretEnvVar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SecretEnvVar.class, + com.google.cloud.functions.v2.SecretEnvVar.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECRET_FIELD_NUMBER = 3; + private volatile java.lang.Object secret_; + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + @java.lang.Override + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + 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(); + secret_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 4; + private volatile java.lang.Object version_; + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, version_); + } + 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.v2.SecretEnvVar)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.SecretEnvVar other = + (com.google.cloud.functions.v2.SecretEnvVar) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSecret().equals(other.getSecret())) return false; + if (!getVersion().equals(other.getVersion())) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.SecretEnvVar parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretEnvVar 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.v2.SecretEnvVar parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretEnvVar 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.v2.SecretEnvVar parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretEnvVar parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.SecretEnvVar parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretEnvVar 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.v2.SecretEnvVar parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretEnvVar 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.v2.SecretEnvVar parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretEnvVar 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.v2.SecretEnvVar 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; + } + /** + * + * + *
+   * Configuration for a secret environment variable. It has the information
+   * necessary to fetch the secret value from secret manager and expose it as an
+   * environment variable.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SecretEnvVar} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.SecretEnvVar) + com.google.cloud.functions.v2.SecretEnvVarOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretEnvVar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretEnvVar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SecretEnvVar.class, + com.google.cloud.functions.v2.SecretEnvVar.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.SecretEnvVar.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(); + key_ = ""; + + projectId_ = ""; + + secret_ = ""; + + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretEnvVar_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretEnvVar getDefaultInstanceForType() { + return com.google.cloud.functions.v2.SecretEnvVar.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretEnvVar build() { + com.google.cloud.functions.v2.SecretEnvVar result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretEnvVar buildPartial() { + com.google.cloud.functions.v2.SecretEnvVar result = + new com.google.cloud.functions.v2.SecretEnvVar(this); + result.key_ = key_; + result.projectId_ = projectId_; + result.secret_ = secret_; + result.version_ = version_; + 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.v2.SecretEnvVar) { + return mergeFrom((com.google.cloud.functions.v2.SecretEnvVar) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.SecretEnvVar other) { + if (other == com.google.cloud.functions.v2.SecretEnvVar.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getSecret().isEmpty()) { + secret_ = other.secret_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + 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.v2.SecretEnvVar parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.SecretEnvVar) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object secret_ = ""; + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The secret. + */ + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + secret_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return This builder for chaining. + */ + public Builder clearSecret() { + + secret_ = getDefaultInstance().getSecret(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The bytes for secret to set. + * @return This builder for chaining. + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + secret_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = 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.v2.SecretEnvVar) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.SecretEnvVar) + private static final com.google.cloud.functions.v2.SecretEnvVar DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.SecretEnvVar(); + } + + public static com.google.cloud.functions.v2.SecretEnvVar getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretEnvVar parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretEnvVar(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.v2.SecretEnvVar getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVarOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVarOrBuilder.java new file mode 100644 index 00000000..4858ec25 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretEnvVarOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface SecretEnvVarOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.SecretEnvVar) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + java.lang.String getSecret(); + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolume.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolume.java new file mode 100644 index 00000000..fbb3dacf --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolume.java @@ -0,0 +1,2502 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Configuration for a secret volume. It has the information necessary to fetch
+ * the secret value from secret manager and make it available as files mounted
+ * at the requested paths within the application container.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SecretVolume} + */ +public final class SecretVolume extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.SecretVolume) + SecretVolumeOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretVolume.newBuilder() to construct. + private SecretVolume(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretVolume() { + mountPath_ = ""; + projectId_ = ""; + secret_ = ""; + versions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretVolume(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretVolume( + 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(); + + mountPath_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + secret_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList< + com.google.cloud.functions.v2.SecretVolume.SecretVersion>(); + mutable_bitField0_ |= 0x00000001; + } + versions_.add( + input.readMessage( + com.google.cloud.functions.v2.SecretVolume.SecretVersion.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SecretVolume.class, + com.google.cloud.functions.v2.SecretVolume.Builder.class); + } + + public interface SecretVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.SecretVolume.SecretVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + } + /** + * + * + *
+   * Configuration for a single version.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SecretVolume.SecretVersion} + */ + public static final class SecretVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.SecretVolume.SecretVersion) + SecretVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretVersion.newBuilder() to construct. + private SecretVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretVersion() { + version_ = ""; + path_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretVersion( + 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(); + + version_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + path_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SecretVolume.SecretVersion.class, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + 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(); + version_ = s; + return s; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object path_; + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + 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(); + path_ = s; + return s; + } + } + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); + } + 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.v2.SecretVolume.SecretVersion)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.SecretVolume.SecretVersion other = + (com.google.cloud.functions.v2.SecretVolume.SecretVersion) obj; + + if (!getVersion().equals(other.getVersion())) return false; + if (!getPath().equals(other.getPath())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion 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.v2.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion 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.v2.SecretVolume.SecretVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion 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.v2.SecretVolume.SecretVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion 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.v2.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion 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.v2.SecretVolume.SecretVersion 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; + } + /** + * + * + *
+     * Configuration for a single version.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SecretVolume.SecretVersion} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.SecretVolume.SecretVersion) + com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SecretVolume.SecretVersion.class, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.SecretVolume.SecretVersion.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(); + version_ = ""; + + path_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume.SecretVersion getDefaultInstanceForType() { + return com.google.cloud.functions.v2.SecretVolume.SecretVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume.SecretVersion build() { + com.google.cloud.functions.v2.SecretVolume.SecretVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume.SecretVersion buildPartial() { + com.google.cloud.functions.v2.SecretVolume.SecretVersion result = + new com.google.cloud.functions.v2.SecretVolume.SecretVersion(this); + result.version_ = version_; + result.path_ = path_; + 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.v2.SecretVolume.SecretVersion) { + return mergeFrom((com.google.cloud.functions.v2.SecretVolume.SecretVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.SecretVolume.SecretVersion other) { + if (other == com.google.cloud.functions.v2.SecretVolume.SecretVersion.getDefaultInstance()) + return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + 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.v2.SecretVolume.SecretVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.SecretVolume.SecretVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + path_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + path_ = 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.v2.SecretVolume.SecretVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.SecretVolume.SecretVersion) + private static final com.google.cloud.functions.v2.SecretVolume.SecretVersion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.SecretVolume.SecretVersion(); + } + + public static com.google.cloud.functions.v2.SecretVolume.SecretVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretVersion(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.v2.SecretVolume.SecretVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int MOUNT_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object mountPath_; + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + @java.lang.Override + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + 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(); + mountPath_ = s; + return s; + } + } + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + 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(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECRET_FIELD_NUMBER = 3; + private volatile java.lang.Object secret_; + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + @java.lang.Override + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + 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(); + secret_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSIONS_FIELD_NUMBER = 4; + private java.util.List versions_; + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public java.util.List + getVersionsList() { + return versions_; + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public java.util.List + getVersionsOrBuilderList() { + return versions_; + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume.SecretVersion getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder( + int index) { + return versions_.get(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 { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mountPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, secret_); + } + for (int i = 0; i < versions_.size(); i++) { + output.writeMessage(4, versions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mountPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, secret_); + } + for (int i = 0; i < versions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, versions_.get(i)); + } + 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.v2.SecretVolume)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.SecretVolume other = + (com.google.cloud.functions.v2.SecretVolume) obj; + + if (!getMountPath().equals(other.getMountPath())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSecret().equals(other.getSecret())) return false; + if (!getVersionsList().equals(other.getVersionsList())) 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) + MOUNT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getMountPath().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret().hashCode(); + if (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.SecretVolume parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretVolume 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.v2.SecretVolume parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretVolume 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.v2.SecretVolume parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SecretVolume parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.SecretVolume parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretVolume 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.v2.SecretVolume parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretVolume 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.v2.SecretVolume parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SecretVolume 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.v2.SecretVolume 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; + } + /** + * + * + *
+   * Configuration for a secret volume. It has the information necessary to fetch
+   * the secret value from secret manager and make it available as files mounted
+   * at the requested paths within the application container.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SecretVolume} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.SecretVolume) + com.google.cloud.functions.v2.SecretVolumeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SecretVolume.class, + com.google.cloud.functions.v2.SecretVolume.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.SecretVolume.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mountPath_ = ""; + + projectId_ = ""; + + secret_ = ""; + + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SecretVolume_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume getDefaultInstanceForType() { + return com.google.cloud.functions.v2.SecretVolume.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume build() { + com.google.cloud.functions.v2.SecretVolume result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume buildPartial() { + com.google.cloud.functions.v2.SecretVolume result = + new com.google.cloud.functions.v2.SecretVolume(this); + int from_bitField0_ = bitField0_; + result.mountPath_ = mountPath_; + result.projectId_ = projectId_; + result.secret_ = secret_; + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versions_ = versions_; + } else { + result.versions_ = versionsBuilder_.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.v2.SecretVolume) { + return mergeFrom((com.google.cloud.functions.v2.SecretVolume) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.SecretVolume other) { + if (other == com.google.cloud.functions.v2.SecretVolume.getDefaultInstance()) return this; + if (!other.getMountPath().isEmpty()) { + mountPath_ = other.mountPath_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getSecret().isEmpty()) { + secret_ = other.secret_; + onChanged(); + } + if (versionsBuilder_ == null) { + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + } else { + if (!other.versions_.isEmpty()) { + if (versionsBuilder_.isEmpty()) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + versionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionsFieldBuilder() + : null; + } else { + versionsBuilder_.addAllMessages(other.versions_); + } + } + } + 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.v2.SecretVolume parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.SecretVolume) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object mountPath_ = ""; + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @param value The mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mountPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearMountPath() { + + mountPath_ = getDefaultInstance().getMountPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @param value The bytes for mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mountPath_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object secret_ = ""; + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The secret. + */ + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + secret_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return This builder for chaining. + */ + public Builder clearSecret() { + + secret_ = getDefaultInstance().getSecret(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The bytes for secret to set. + * @return This builder for chaining. + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + secret_ = value; + onChanged(); + return this; + } + + private java.util.List versions_ = + java.util.Collections.emptyList(); + + private void ensureVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList( + versions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretVolume.SecretVersion, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder> + versionsBuilder_; + + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public java.util.List + getVersionsList() { + if (versionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versions_); + } else { + return versionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public int getVersionsCount() { + if (versionsBuilder_ == null) { + return versions_.size(); + } else { + return versionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2.SecretVolume.SecretVersion getVersions(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder setVersions( + int index, com.google.cloud.functions.v2.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + onChanged(); + } else { + versionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder setVersions( + int index, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.set(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions(com.google.cloud.functions.v2.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + onChanged(); + } else { + versionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions( + int index, com.google.cloud.functions.v2.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(index, value); + onChanged(); + } else { + versionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions( + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions( + int index, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder addAllVersions( + java.lang.Iterable + values) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + onChanged(); + } else { + versionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder clearVersions() { + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public Builder removeVersions(int index) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.remove(index); + onChanged(); + } else { + versionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder getVersionsBuilder( + int index) { + return getVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder( + int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public java.util.List< + ? extends com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder> + getVersionsOrBuilderList() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versions_); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder addVersionsBuilder() { + return getVersionsFieldBuilder() + .addBuilder( + com.google.cloud.functions.v2.SecretVolume.SecretVersion.getDefaultInstance()); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder addVersionsBuilder( + int index) { + return getVersionsFieldBuilder() + .addBuilder( + index, com.google.cloud.functions.v2.SecretVolume.SecretVersion.getDefaultInstance()); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + public java.util.List + getVersionsBuilderList() { + return getVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretVolume.SecretVersion, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretVolume.SecretVersion, + com.google.cloud.functions.v2.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder>( + versions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + @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.v2.SecretVolume) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.SecretVolume) + private static final com.google.cloud.functions.v2.SecretVolume DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.SecretVolume(); + } + + public static com.google.cloud.functions.v2.SecretVolume getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretVolume parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretVolume(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.v2.SecretVolume getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolumeOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolumeOrBuilder.java new file mode 100644 index 00000000..4a94e20c --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SecretVolumeOrBuilder.java @@ -0,0 +1,174 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface SecretVolumeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.SecretVolume) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + java.lang.String getMountPath(); + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + com.google.protobuf.ByteString getMountPathBytes(); + + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + java.lang.String getSecret(); + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + com.google.cloud.functions.v2.SecretVolume.SecretVersion getVersions(int index); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + int getVersionsCount(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + java.util.List + getVersionsOrBuilderList(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume.SecretVersion versions = 4; + */ + com.google.cloud.functions.v2.SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java new file mode 100644 index 00000000..22553026 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java @@ -0,0 +1,4130 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Describes the Service being deployed.
+ * Currently Supported : Cloud Run (fully managed).
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ServiceConfig} + */ +public final class ServiceConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.ServiceConfig) + ServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceConfig.newBuilder() to construct. + private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceConfig() { + service_ = ""; + availableMemory_ = ""; + vpcConnector_ = ""; + vpcConnectorEgressSettings_ = 0; + ingressSettings_ = 0; + uri_ = ""; + serviceAccountEmail_ = ""; + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + secretVolumes_ = java.util.Collections.emptyList(); + revision_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceConfig( + 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(); + + service_ = s; + break; + } + case 16: + { + timeoutSeconds_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 40: + { + maxInstanceCount_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + vpcConnector_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + vpcConnectorEgressSettings_ = rawValue; + break; + } + case 64: + { + int rawValue = input.readEnum(); + + ingressSettings_ = rawValue; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 96: + { + minInstanceCount_ = input.readInt32(); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + availableMemory_ = s; + break; + } + case 128: + { + allTrafficOnLatestRevision_ = input.readBool(); + break; + } + case 138: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + secretEnvironmentVariables_.add( + input.readMessage( + com.google.cloud.functions.v2.SecretEnvVar.parser(), extensionRegistry)); + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + + revision_ = s; + break; + } + case 154: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + secretVolumes_.add( + input.readMessage( + com.google.cloud.functions.v2.SecretVolume.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ServiceConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + 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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ServiceConfig.class, + com.google.cloud.functions.v2.ServiceConfig.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.v2.ServiceConfig.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.v2.ServiceConfig.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.v2.ServiceConfig.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.v2.ServiceConfig.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.v2.ServiceConfig.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.v2.ServiceConfig.IngressSettings) + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private volatile java.lang.Object service_; + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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 TIMEOUT_SECONDS_FIELD_NUMBER = 2; + private int timeoutSeconds_; + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + @java.lang.Override + public int getTimeoutSeconds() { + return timeoutSeconds_; + } + + public static final int AVAILABLE_MEMORY_FIELD_NUMBER = 13; + private volatile java.lang.Object availableMemory_; + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + @java.lang.Override + public java.lang.String getAvailableMemory() { + java.lang.Object ref = availableMemory_; + 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(); + availableMemory_ = s; + return s; + } + } + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvailableMemoryBytes() { + java.lang.Object ref = availableMemory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableMemory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 4; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ServiceConfig_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 = 4; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 4; + */ + @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 = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int MAX_INSTANCE_COUNT_FIELD_NUMBER = 5; + private int maxInstanceCount_; + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+   * short period of time, create more instances than the specified max
+   * instances limit. If your function cannot tolerate this temporary behavior,
+   * you may want to factor in a safety margin and set a lower max instances
+   * value than your function can tolerate.
+   * See the [Max
+   * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+   * more details.
+   * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + @java.lang.Override + public int getMaxInstanceCount() { + return maxInstanceCount_; + } + + public static final int MIN_INSTANCE_COUNT_FIELD_NUMBER = 12; + private int minInstanceCount_; + /** + * + * + *
+   * The limit on the minimum number of function instances that may coexist at a
+   * given time.
+   * Function instances are kept in idle state for a short period after they
+   * finished executing the request to reduce cold start time for subsequent
+   * requests. Setting a minimum instance count will ensure that the given
+   * number of instances are kept running in idle state always. This can help
+   * with cold start times when jump in incoming request count occurs after the
+   * idle instance would have been stopped in the default case.
+   * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + @java.lang.Override + public int getMinInstanceCount() { + return minInstanceCount_; + } + + public static final int VPC_CONNECTOR_FIELD_NUMBER = 6; + private volatile java.lang.Object vpcConnector_; + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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 Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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 = 7; + private int vpcConnectorEgressSettings_; + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings result = + com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + + public static final int INGRESS_SETTINGS_FIELD_NUMBER = 8; + private int ingressSettings_; + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @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.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.ServiceConfig.IngressSettings result = + com.google.cloud.functions.v2.ServiceConfig.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v2.ServiceConfig.IngressSettings.UNRECOGNIZED + : result; + } + + public static final int URI_FIELD_NUMBER = 9; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + 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(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 10; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @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 service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @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 ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER = 16; + private boolean allTrafficOnLatestRevision_; + /** + * + * + *
+   * Whether 100% of traffic is routed to the latest revision.
+   * On CreateFunction and UpdateFunction, when set to true, the revision being
+   * deployed will serve 100% of traffic, ignoring any traffic split settings,
+   * if any. On GetFunction, true will be returned if the latest revision is
+   * serving 100% of traffic.
+   * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + @java.lang.Override + public boolean getAllTrafficOnLatestRevision() { + return allTrafficOnLatestRevision_; + } + + public static final int SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER = 17; + private java.util.List secretEnvironmentVariables_; + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public java.util.List + getSecretEnvironmentVariablesList() { + return secretEnvironmentVariables_; + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public java.util.List + getSecretEnvironmentVariablesOrBuilderList() { + return secretEnvironmentVariables_; + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public int getSecretEnvironmentVariablesCount() { + return secretEnvironmentVariables_.size(); + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.SecretEnvVar getSecretEnvironmentVariables(int index) { + return secretEnvironmentVariables_.get(index); + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.SecretEnvVarOrBuilder getSecretEnvironmentVariablesOrBuilder( + int index) { + return secretEnvironmentVariables_.get(index); + } + + public static final int SECRET_VOLUMES_FIELD_NUMBER = 19; + private java.util.List secretVolumes_; + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public java.util.List getSecretVolumesList() { + return secretVolumes_; + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public java.util.List + getSecretVolumesOrBuilderList() { + return secretVolumes_; + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public int getSecretVolumesCount() { + return secretVolumes_.size(); + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolume getSecretVolumes(int index) { + return secretVolumes_.get(index); + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public com.google.cloud.functions.v2.SecretVolumeOrBuilder getSecretVolumesOrBuilder(int index) { + return secretVolumes_.get(index); + } + + public static final int REVISION_FIELD_NUMBER = 18; + private volatile java.lang.Object revision_; + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + @java.lang.Override + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + 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(); + revision_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revision_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + if (timeoutSeconds_ != 0) { + output.writeInt32(2, timeoutSeconds_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 4); + if (maxInstanceCount_ != 0) { + output.writeInt32(5, maxInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vpcConnector_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v2.ServiceConfig.IngressSettings.INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, ingressSettings_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, serviceAccountEmail_); + } + if (minInstanceCount_ != 0) { + output.writeInt32(12, minInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableMemory_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, availableMemory_); + } + if (allTrafficOnLatestRevision_ != false) { + output.writeBool(16, allTrafficOnLatestRevision_); + } + for (int i = 0; i < secretEnvironmentVariables_.size(); i++) { + output.writeMessage(17, secretEnvironmentVariables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, revision_); + } + for (int i = 0; i < secretVolumes_.size(); i++) { + output.writeMessage(19, secretVolumes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + if (timeoutSeconds_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, timeoutSeconds_); + } + 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(4, environmentVariables__); + } + if (maxInstanceCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vpcConnector_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v2.ServiceConfig.IngressSettings.INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, ingressSettings_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, serviceAccountEmail_); + } + if (minInstanceCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(12, minInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableMemory_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, availableMemory_); + } + if (allTrafficOnLatestRevision_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(16, allTrafficOnLatestRevision_); + } + for (int i = 0; i < secretEnvironmentVariables_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, secretEnvironmentVariables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, revision_); + } + for (int i = 0; i < secretVolumes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, secretVolumes_.get(i)); + } + 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.v2.ServiceConfig)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.ServiceConfig other = + (com.google.cloud.functions.v2.ServiceConfig) obj; + + if (!getService().equals(other.getService())) return false; + if (getTimeoutSeconds() != other.getTimeoutSeconds()) return false; + if (!getAvailableMemory().equals(other.getAvailableMemory())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (getMaxInstanceCount() != other.getMaxInstanceCount()) return false; + if (getMinInstanceCount() != other.getMinInstanceCount()) return false; + if (!getVpcConnector().equals(other.getVpcConnector())) return false; + if (vpcConnectorEgressSettings_ != other.vpcConnectorEgressSettings_) return false; + if (ingressSettings_ != other.ingressSettings_) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (getAllTrafficOnLatestRevision() != other.getAllTrafficOnLatestRevision()) return false; + if (!getSecretEnvironmentVariablesList().equals(other.getSecretEnvironmentVariablesList())) + return false; + if (!getSecretVolumesList().equals(other.getSecretVolumesList())) return false; + if (!getRevision().equals(other.getRevision())) 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) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + TIMEOUT_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getTimeoutSeconds(); + hash = (37 * hash) + AVAILABLE_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableMemory().hashCode(); + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + MAX_INSTANCE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxInstanceCount(); + hash = (37 * hash) + MIN_INSTANCE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinInstanceCount(); + 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) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllTrafficOnLatestRevision()); + if (getSecretEnvironmentVariablesCount() > 0) { + hash = (37 * hash) + SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + getSecretEnvironmentVariablesList().hashCode(); + } + if (getSecretVolumesCount() > 0) { + hash = (37 * hash) + SECRET_VOLUMES_FIELD_NUMBER; + hash = (53 * hash) + getSecretVolumesList().hashCode(); + } + hash = (37 * hash) + REVISION_FIELD_NUMBER; + hash = (53 * hash) + getRevision().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.ServiceConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ServiceConfig 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.v2.ServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ServiceConfig 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.v2.ServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.ServiceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.ServiceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ServiceConfig 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.v2.ServiceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ServiceConfig 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.v2.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.ServiceConfig 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.v2.ServiceConfig 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 Service being deployed.
+   * Currently Supported : Cloud Run (fully managed).
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.ServiceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.ServiceConfig) + com.google.cloud.functions.v2.ServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ServiceConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + 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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.ServiceConfig.class, + com.google.cloud.functions.v2.ServiceConfig.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.ServiceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSecretEnvironmentVariablesFieldBuilder(); + getSecretVolumesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + service_ = ""; + + timeoutSeconds_ = 0; + + availableMemory_ = ""; + + internalGetMutableEnvironmentVariables().clear(); + maxInstanceCount_ = 0; + + minInstanceCount_ = 0; + + vpcConnector_ = ""; + + vpcConnectorEgressSettings_ = 0; + + ingressSettings_ = 0; + + uri_ = ""; + + serviceAccountEmail_ = ""; + + allTrafficOnLatestRevision_ = false; + + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + secretEnvironmentVariablesBuilder_.clear(); + } + if (secretVolumesBuilder_ == null) { + secretVolumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + secretVolumesBuilder_.clear(); + } + revision_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_ServiceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig getDefaultInstanceForType() { + return com.google.cloud.functions.v2.ServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig build() { + com.google.cloud.functions.v2.ServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig buildPartial() { + com.google.cloud.functions.v2.ServiceConfig result = + new com.google.cloud.functions.v2.ServiceConfig(this); + int from_bitField0_ = bitField0_; + result.service_ = service_; + result.timeoutSeconds_ = timeoutSeconds_; + result.availableMemory_ = availableMemory_; + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.maxInstanceCount_ = maxInstanceCount_; + result.minInstanceCount_ = minInstanceCount_; + result.vpcConnector_ = vpcConnector_; + result.vpcConnectorEgressSettings_ = vpcConnectorEgressSettings_; + result.ingressSettings_ = ingressSettings_; + result.uri_ = uri_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.allTrafficOnLatestRevision_ = allTrafficOnLatestRevision_; + if (secretEnvironmentVariablesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.secretEnvironmentVariables_ = secretEnvironmentVariables_; + } else { + result.secretEnvironmentVariables_ = secretEnvironmentVariablesBuilder_.build(); + } + if (secretVolumesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.secretVolumes_ = secretVolumes_; + } else { + result.secretVolumes_ = secretVolumesBuilder_.build(); + } + result.revision_ = revision_; + 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.v2.ServiceConfig) { + return mergeFrom((com.google.cloud.functions.v2.ServiceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { + if (other == com.google.cloud.functions.v2.ServiceConfig.getDefaultInstance()) return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + onChanged(); + } + if (other.getTimeoutSeconds() != 0) { + setTimeoutSeconds(other.getTimeoutSeconds()); + } + if (!other.getAvailableMemory().isEmpty()) { + availableMemory_ = other.availableMemory_; + onChanged(); + } + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (other.getMaxInstanceCount() != 0) { + setMaxInstanceCount(other.getMaxInstanceCount()); + } + if (other.getMinInstanceCount() != 0) { + setMinInstanceCount(other.getMinInstanceCount()); + } + if (!other.getVpcConnector().isEmpty()) { + vpcConnector_ = other.vpcConnector_; + onChanged(); + } + if (other.vpcConnectorEgressSettings_ != 0) { + setVpcConnectorEgressSettingsValue(other.getVpcConnectorEgressSettingsValue()); + } + if (other.ingressSettings_ != 0) { + setIngressSettingsValue(other.getIngressSettingsValue()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.getAllTrafficOnLatestRevision() != false) { + setAllTrafficOnLatestRevision(other.getAllTrafficOnLatestRevision()); + } + if (secretEnvironmentVariablesBuilder_ == null) { + if (!other.secretEnvironmentVariables_.isEmpty()) { + if (secretEnvironmentVariables_.isEmpty()) { + secretEnvironmentVariables_ = other.secretEnvironmentVariables_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.addAll(other.secretEnvironmentVariables_); + } + onChanged(); + } + } else { + if (!other.secretEnvironmentVariables_.isEmpty()) { + if (secretEnvironmentVariablesBuilder_.isEmpty()) { + secretEnvironmentVariablesBuilder_.dispose(); + secretEnvironmentVariablesBuilder_ = null; + secretEnvironmentVariables_ = other.secretEnvironmentVariables_; + bitField0_ = (bitField0_ & ~0x00000002); + secretEnvironmentVariablesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSecretEnvironmentVariablesFieldBuilder() + : null; + } else { + secretEnvironmentVariablesBuilder_.addAllMessages(other.secretEnvironmentVariables_); + } + } + } + if (secretVolumesBuilder_ == null) { + if (!other.secretVolumes_.isEmpty()) { + if (secretVolumes_.isEmpty()) { + secretVolumes_ = other.secretVolumes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSecretVolumesIsMutable(); + secretVolumes_.addAll(other.secretVolumes_); + } + onChanged(); + } + } else { + if (!other.secretVolumes_.isEmpty()) { + if (secretVolumesBuilder_.isEmpty()) { + secretVolumesBuilder_.dispose(); + secretVolumesBuilder_ = null; + secretVolumes_ = other.secretVolumes_; + bitField0_ = (bitField0_ & ~0x00000004); + secretVolumesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSecretVolumesFieldBuilder() + : null; + } else { + secretVolumesBuilder_.addAllMessages(other.secretVolumes_); + } + } + } + if (!other.getRevision().isEmpty()) { + revision_ = other.revision_; + 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.v2.ServiceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.ServiceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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 int timeoutSeconds_; + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + @java.lang.Override + public int getTimeoutSeconds() { + return timeoutSeconds_; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @param value The timeoutSeconds to set. + * @return This builder for chaining. + */ + public Builder setTimeoutSeconds(int value) { + + timeoutSeconds_ = value; + onChanged(); + 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.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @return This builder for chaining. + */ + public Builder clearTimeoutSeconds() { + + timeoutSeconds_ = 0; + onChanged(); + return this; + } + + private java.lang.Object availableMemory_ = ""; + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + public java.lang.String getAvailableMemory() { + java.lang.Object ref = availableMemory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availableMemory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + public com.google.protobuf.ByteString getAvailableMemoryBytes() { + java.lang.Object ref = availableMemory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableMemory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @param value The availableMemory to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + availableMemory_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return This builder for chaining. + */ + public Builder clearAvailableMemory() { + + availableMemory_ = getDefaultInstance().getAvailableMemory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @param value The bytes for availableMemory to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + availableMemory_ = value; + onChanged(); + 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 = 4; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 4; + */ + @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 = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 4; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + 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 = 4; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private int maxInstanceCount_; + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + @java.lang.Override + public int getMaxInstanceCount() { + return maxInstanceCount_; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @param value The maxInstanceCount to set. + * @return This builder for chaining. + */ + public Builder setMaxInstanceCount(int value) { + + maxInstanceCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxInstanceCount() { + + maxInstanceCount_ = 0; + onChanged(); + return this; + } + + private int minInstanceCount_; + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + @java.lang.Override + public int getMinInstanceCount() { + return minInstanceCount_; + } + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @param value The minInstanceCount to set. + * @return This builder for chaining. + */ + public Builder setMinInstanceCount(int value) { + + minInstanceCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @return This builder for chaining. + */ + public Builder clearMinInstanceCount() { + + minInstanceCount_ = 0; + onChanged(); + return this; + } + + private java.lang.Object vpcConnector_ = ""; + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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 Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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 Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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 Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearVpcConnector() { + + vpcConnector_ = getDefaultInstance().getVpcConnector(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings result = + com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @param value The vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettings( + com.google.cloud.functions.v2.ServiceConfig.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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @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.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @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.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @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.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.ServiceConfig.IngressSettings result = + com.google.cloud.functions.v2.ServiceConfig.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v2.ServiceConfig.IngressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @param value The ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettings( + com.google.cloud.functions.v2.ServiceConfig.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.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return This builder for chaining. + */ + public Builder clearIngressSettings() { + + ingressSettings_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @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 service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @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 service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @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 service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @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 boolean allTrafficOnLatestRevision_; + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + @java.lang.Override + public boolean getAllTrafficOnLatestRevision() { + return allTrafficOnLatestRevision_; + } + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @param value The allTrafficOnLatestRevision to set. + * @return This builder for chaining. + */ + public Builder setAllTrafficOnLatestRevision(boolean value) { + + allTrafficOnLatestRevision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return This builder for chaining. + */ + public Builder clearAllTrafficOnLatestRevision() { + + allTrafficOnLatestRevision_ = false; + onChanged(); + return this; + } + + private java.util.List secretEnvironmentVariables_ = + java.util.Collections.emptyList(); + + private void ensureSecretEnvironmentVariablesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + new java.util.ArrayList( + secretEnvironmentVariables_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretEnvVar, + com.google.cloud.functions.v2.SecretEnvVar.Builder, + com.google.cloud.functions.v2.SecretEnvVarOrBuilder> + secretEnvironmentVariablesBuilder_; + + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesList() { + if (secretEnvironmentVariablesBuilder_ == null) { + return java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } else { + return secretEnvironmentVariablesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public int getSecretEnvironmentVariablesCount() { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.size(); + } else { + return secretEnvironmentVariablesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2.SecretEnvVar getSecretEnvironmentVariables(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.get(index); + } else { + return secretEnvironmentVariablesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder setSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.set(index, value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder setSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.set(index, builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables(com.google.cloud.functions.v2.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(index, value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + com.google.cloud.functions.v2.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(index, builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addAllSecretEnvironmentVariables( + java.lang.Iterable values) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secretEnvironmentVariables_); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder clearSecretEnvironmentVariables() { + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder removeSecretEnvironmentVariables(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.remove(index); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2.SecretEnvVar.Builder getSecretEnvironmentVariablesBuilder( + int index) { + return getSecretEnvironmentVariablesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2.SecretEnvVarOrBuilder + getSecretEnvironmentVariablesOrBuilder(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.get(index); + } else { + return secretEnvironmentVariablesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesOrBuilderList() { + if (secretEnvironmentVariablesBuilder_ != null) { + return secretEnvironmentVariablesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2.SecretEnvVar.Builder + addSecretEnvironmentVariablesBuilder() { + return getSecretEnvironmentVariablesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.SecretEnvVar.getDefaultInstance()); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2.SecretEnvVar.Builder addSecretEnvironmentVariablesBuilder( + int index) { + return getSecretEnvironmentVariablesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.SecretEnvVar.getDefaultInstance()); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesBuilderList() { + return getSecretEnvironmentVariablesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretEnvVar, + com.google.cloud.functions.v2.SecretEnvVar.Builder, + com.google.cloud.functions.v2.SecretEnvVarOrBuilder> + getSecretEnvironmentVariablesFieldBuilder() { + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariablesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretEnvVar, + com.google.cloud.functions.v2.SecretEnvVar.Builder, + com.google.cloud.functions.v2.SecretEnvVarOrBuilder>( + secretEnvironmentVariables_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + secretEnvironmentVariables_ = null; + } + return secretEnvironmentVariablesBuilder_; + } + + private java.util.List secretVolumes_ = + java.util.Collections.emptyList(); + + private void ensureSecretVolumesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = + new java.util.ArrayList(secretVolumes_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretVolume, + com.google.cloud.functions.v2.SecretVolume.Builder, + com.google.cloud.functions.v2.SecretVolumeOrBuilder> + secretVolumesBuilder_; + + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public java.util.List getSecretVolumesList() { + if (secretVolumesBuilder_ == null) { + return java.util.Collections.unmodifiableList(secretVolumes_); + } else { + return secretVolumesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public int getSecretVolumesCount() { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.size(); + } else { + return secretVolumesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2.SecretVolume getSecretVolumes(int index) { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.get(index); + } else { + return secretVolumesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder setSecretVolumes(int index, com.google.cloud.functions.v2.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.set(index, value); + onChanged(); + } else { + secretVolumesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder setSecretVolumes( + int index, com.google.cloud.functions.v2.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.set(index, builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes(com.google.cloud.functions.v2.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.add(value); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes(int index, com.google.cloud.functions.v2.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.add(index, value); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + com.google.cloud.functions.v2.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.add(builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + int index, com.google.cloud.functions.v2.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.add(index, builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder addAllSecretVolumes( + java.lang.Iterable values) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secretVolumes_); + onChanged(); + } else { + secretVolumesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder clearSecretVolumes() { + if (secretVolumesBuilder_ == null) { + secretVolumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + secretVolumesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public Builder removeSecretVolumes(int index) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.remove(index); + onChanged(); + } else { + secretVolumesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2.SecretVolume.Builder getSecretVolumesBuilder(int index) { + return getSecretVolumesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2.SecretVolumeOrBuilder getSecretVolumesOrBuilder( + int index) { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.get(index); + } else { + return secretVolumesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public java.util.List + getSecretVolumesOrBuilderList() { + if (secretVolumesBuilder_ != null) { + return secretVolumesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(secretVolumes_); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2.SecretVolume.Builder addSecretVolumesBuilder() { + return getSecretVolumesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.SecretVolume.getDefaultInstance()); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2.SecretVolume.Builder addSecretVolumesBuilder(int index) { + return getSecretVolumesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.SecretVolume.getDefaultInstance()); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + public java.util.List + getSecretVolumesBuilderList() { + return getSecretVolumesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretVolume, + com.google.cloud.functions.v2.SecretVolume.Builder, + com.google.cloud.functions.v2.SecretVolumeOrBuilder> + getSecretVolumesFieldBuilder() { + if (secretVolumesBuilder_ == null) { + secretVolumesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.SecretVolume, + com.google.cloud.functions.v2.SecretVolume.Builder, + com.google.cloud.functions.v2.SecretVolumeOrBuilder>( + secretVolumes_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + secretVolumes_ = null; + } + return secretVolumesBuilder_; + } + + private java.lang.Object revision_ = ""; + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + public com.google.protobuf.ByteString getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The revision to set. + * @return This builder for chaining. + */ + public Builder setRevision(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRevision() { + + revision_ = getDefaultInstance().getRevision(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for revision to set. + * @return This builder for chaining. + */ + public Builder setRevisionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revision_ = 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.v2.ServiceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.ServiceConfig) + private static final com.google.cloud.functions.v2.ServiceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.ServiceConfig(); + } + + public static com.google.cloud.functions.v2.ServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceConfig(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.v2.ServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java new file mode 100644 index 00000000..07bae17a --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java @@ -0,0 +1,499 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface ServiceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.ServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * 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.
+   * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + int getTimeoutSeconds(); + + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + java.lang.String getAvailableMemory(); + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + com.google.protobuf.ByteString getAvailableMemoryBytes(); + + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + 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 = 4; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + + /* nullable */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+   * short period of time, create more instances than the specified max
+   * instances limit. If your function cannot tolerate this temporary behavior,
+   * you may want to factor in a safety margin and set a lower max instances
+   * value than your function can tolerate.
+   * See the [Max
+   * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+   * more details.
+   * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + int getMaxInstanceCount(); + + /** + * + * + *
+   * The limit on the minimum number of function instances that may coexist at a
+   * given time.
+   * Function instances are kept in idle state for a short period after they
+   * finished executing the request to reduce cold start time for subsequent
+   * requests. Setting a minimum instance count will ensure that the given
+   * number of instances are kept running in idle state always. This can help
+   * with cold start times when jump in incoming request count occurs after the
+   * idle instance would have been stopped in the default case.
+   * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + int getMinInstanceCount(); + + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + java.lang.String getVpcConnector(); + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @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.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + com.google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings(); + + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @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.v2.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The ingressSettings. + */ + com.google.cloud.functions.v2.ServiceConfig.IngressSettings getIngressSettings(); + + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Whether 100% of traffic is routed to the latest revision.
+   * On CreateFunction and UpdateFunction, when set to true, the revision being
+   * deployed will serve 100% of traffic, ignoring any traffic split settings,
+   * if any. On GetFunction, true will be returned if the latest revision is
+   * serving 100% of traffic.
+   * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + boolean getAllTrafficOnLatestRevision(); + + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + java.util.List getSecretEnvironmentVariablesList(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + com.google.cloud.functions.v2.SecretEnvVar getSecretEnvironmentVariables(int index); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + int getSecretEnvironmentVariablesCount(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + java.util.List + getSecretEnvironmentVariablesOrBuilderList(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17; + * + */ + com.google.cloud.functions.v2.SecretEnvVarOrBuilder getSecretEnvironmentVariablesOrBuilder( + int index); + + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + java.util.List getSecretVolumesList(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + com.google.cloud.functions.v2.SecretVolume getSecretVolumes(int index); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + int getSecretVolumesCount(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + java.util.List + getSecretVolumesOrBuilderList(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19; + */ + com.google.cloud.functions.v2.SecretVolumeOrBuilder getSecretVolumesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + java.lang.String getRevision(); + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + com.google.protobuf.ByteString getRevisionBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Source.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Source.java new file mode 100644 index 00000000..02859b8c --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Source.java @@ -0,0 +1,1151 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * The location of the function source code.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.Source} + */ +public final class Source extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.Source) + SourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Source() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Source(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Source( + 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.v2.StorageSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = ((com.google.cloud.functions.v2.StorageSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v2.StorageSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.functions.v2.RepoSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.functions.v2.RepoSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2.RepoSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v2.RepoSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.Source.class, + com.google.cloud.functions.v2.Source.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STORAGE_SOURCE(1), + REPO_SOURCE(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(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 SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return STORAGE_SOURCE; + case 2: + return REPO_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int STORAGE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource getStorageSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2.StorageSource) source_; + } + return com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2.StorageSource) source_; + } + return com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } + + public static final int REPO_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + @java.lang.Override + public boolean hasRepoSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.RepoSource getRepoSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2.RepoSource) source_; + } + return com.google.cloud.functions.v2.RepoSource.getDefaultInstance(); + } + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2.RepoSourceOrBuilder getRepoSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2.RepoSource) source_; + } + return com.google.cloud.functions.v2.RepoSource.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 (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.functions.v2.StorageSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.functions.v2.RepoSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.functions.v2.StorageSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.functions.v2.RepoSource) source_); + } + 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.v2.Source)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.Source other = (com.google.cloud.functions.v2.Source) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getStorageSource().equals(other.getStorageSource())) return false; + break; + case 2: + if (!getRepoSource().equals(other.getRepoSource())) 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 (sourceCase_) { + case 1: + hash = (37 * hash) + STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getStorageSource().hashCode(); + break; + case 2: + hash = (37 * hash) + REPO_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRepoSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.Source parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Source 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.v2.Source parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Source 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.v2.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Source parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.Source parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Source 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.v2.Source parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Source 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.v2.Source parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Source 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.v2.Source 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; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.Source} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.Source) + com.google.cloud.functions.v2.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.Source.class, + com.google.cloud.functions.v2.Source.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.Source.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(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.Source getDefaultInstanceForType() { + return com.google.cloud.functions.v2.Source.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.Source build() { + com.google.cloud.functions.v2.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.Source buildPartial() { + com.google.cloud.functions.v2.Source result = new com.google.cloud.functions.v2.Source(this); + if (sourceCase_ == 1) { + if (storageSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = storageSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (repoSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = repoSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + 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.v2.Source) { + return mergeFrom((com.google.cloud.functions.v2.Source) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.Source other) { + if (other == com.google.cloud.functions.v2.Source.getDefaultInstance()) return this; + switch (other.getSourceCase()) { + case STORAGE_SOURCE: + { + mergeStorageSource(other.getStorageSource()); + break; + } + case REPO_SOURCE: + { + mergeRepoSource(other.getRepoSource()); + break; + } + case SOURCE_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.v2.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.Source) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder> + storageSourceBuilder_; + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource getStorageSource() { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2.StorageSource) source_; + } + return com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return storageSourceBuilder_.getMessage(); + } + return com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + public Builder setStorageSource(com.google.cloud.functions.v2.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + storageSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + public Builder setStorageSource( + com.google.cloud.functions.v2.StorageSource.Builder builderForValue) { + if (storageSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + storageSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + public Builder mergeStorageSource(com.google.cloud.functions.v2.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.functions.v2.StorageSource.getDefaultInstance()) { + source_ = + com.google.cloud.functions.v2.StorageSource.newBuilder( + (com.google.cloud.functions.v2.StorageSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + storageSourceBuilder_.mergeFrom(value); + } else { + storageSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + public Builder clearStorageSource() { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + storageSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + public com.google.cloud.functions.v2.StorageSource.Builder getStorageSourceBuilder() { + return getStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if ((sourceCase_ == 1) && (storageSourceBuilder_ != null)) { + return storageSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2.StorageSource) source_; + } + return com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder> + getStorageSourceFieldBuilder() { + if (storageSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } + storageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder>( + (com.google.cloud.functions.v2.StorageSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return storageSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.RepoSource, + com.google.cloud.functions.v2.RepoSource.Builder, + com.google.cloud.functions.v2.RepoSourceOrBuilder> + repoSourceBuilder_; + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + @java.lang.Override + public boolean hasRepoSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.RepoSource getRepoSource() { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2.RepoSource) source_; + } + return com.google.cloud.functions.v2.RepoSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return repoSourceBuilder_.getMessage(); + } + return com.google.cloud.functions.v2.RepoSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + public Builder setRepoSource(com.google.cloud.functions.v2.RepoSource value) { + if (repoSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + repoSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + public Builder setRepoSource(com.google.cloud.functions.v2.RepoSource.Builder builderForValue) { + if (repoSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + repoSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + public Builder mergeRepoSource(com.google.cloud.functions.v2.RepoSource value) { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.functions.v2.RepoSource.getDefaultInstance()) { + source_ = + com.google.cloud.functions.v2.RepoSource.newBuilder( + (com.google.cloud.functions.v2.RepoSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + repoSourceBuilder_.mergeFrom(value); + } else { + repoSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + public Builder clearRepoSource() { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + repoSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + public com.google.cloud.functions.v2.RepoSource.Builder getRepoSourceBuilder() { + return getRepoSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2.RepoSourceOrBuilder getRepoSourceOrBuilder() { + if ((sourceCase_ == 2) && (repoSourceBuilder_ != null)) { + return repoSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2.RepoSource) source_; + } + return com.google.cloud.functions.v2.RepoSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.RepoSource, + com.google.cloud.functions.v2.RepoSource.Builder, + com.google.cloud.functions.v2.RepoSourceOrBuilder> + getRepoSourceFieldBuilder() { + if (repoSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.functions.v2.RepoSource.getDefaultInstance(); + } + repoSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.RepoSource, + com.google.cloud.functions.v2.RepoSource.Builder, + com.google.cloud.functions.v2.RepoSourceOrBuilder>( + (com.google.cloud.functions.v2.RepoSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return repoSourceBuilder_; + } + + @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.v2.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.Source) + private static final com.google.cloud.functions.v2.Source DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.Source(); + } + + public static com.google.cloud.functions.v2.Source getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(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.v2.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceOrBuilder.java new file mode 100644 index 00000000..c379183c --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface SourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.Source) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + boolean hasStorageSource(); + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + com.google.cloud.functions.v2.StorageSource getStorageSource(); + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource storage_source = 1; + */ + com.google.cloud.functions.v2.StorageSourceOrBuilder getStorageSourceOrBuilder(); + + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + boolean hasRepoSource(); + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + com.google.cloud.functions.v2.RepoSource getRepoSource(); + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource repo_source = 2; + */ + com.google.cloud.functions.v2.RepoSourceOrBuilder getRepoSourceOrBuilder(); + + public com.google.cloud.functions.v2.Source.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenance.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenance.java new file mode 100644 index 00000000..594f2e81 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenance.java @@ -0,0 +1,1040 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Provenance of the source. Ways to find the original source, or verify that
+ * some source was used for this build.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SourceProvenance} + */ +public final class SourceProvenance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.SourceProvenance) + SourceProvenanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use SourceProvenance.newBuilder() to construct. + private SourceProvenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SourceProvenance() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SourceProvenance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SourceProvenance( + 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.v2.StorageSource.Builder subBuilder = null; + if (resolvedStorageSource_ != null) { + subBuilder = resolvedStorageSource_.toBuilder(); + } + resolvedStorageSource_ = + input.readMessage( + com.google.cloud.functions.v2.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedStorageSource_); + resolvedStorageSource_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.functions.v2.RepoSource.Builder subBuilder = null; + if (resolvedRepoSource_ != null) { + subBuilder = resolvedRepoSource_.toBuilder(); + } + resolvedRepoSource_ = + input.readMessage( + com.google.cloud.functions.v2.RepoSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedRepoSource_); + resolvedRepoSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SourceProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SourceProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SourceProvenance.class, + com.google.cloud.functions.v2.SourceProvenance.Builder.class); + } + + public static final int RESOLVED_STORAGE_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.functions.v2.StorageSource resolvedStorageSource_; + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + @java.lang.Override + public boolean hasResolvedStorageSource() { + return resolvedStorageSource_ != null; + } + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource getResolvedStorageSource() { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StorageSourceOrBuilder getResolvedStorageSourceOrBuilder() { + return getResolvedStorageSource(); + } + + public static final int RESOLVED_REPO_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2.RepoSource resolvedRepoSource_; + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + @java.lang.Override + public boolean hasResolvedRepoSource() { + return resolvedRepoSource_ != null; + } + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2.RepoSource getResolvedRepoSource() { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder() { + return getResolvedRepoSource(); + } + + 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 (resolvedStorageSource_ != null) { + output.writeMessage(1, getResolvedStorageSource()); + } + if (resolvedRepoSource_ != null) { + output.writeMessage(2, getResolvedRepoSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resolvedStorageSource_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResolvedStorageSource()); + } + if (resolvedRepoSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResolvedRepoSource()); + } + 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.v2.SourceProvenance)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.SourceProvenance other = + (com.google.cloud.functions.v2.SourceProvenance) obj; + + if (hasResolvedStorageSource() != other.hasResolvedStorageSource()) return false; + if (hasResolvedStorageSource()) { + if (!getResolvedStorageSource().equals(other.getResolvedStorageSource())) return false; + } + if (hasResolvedRepoSource() != other.hasResolvedRepoSource()) return false; + if (hasResolvedRepoSource()) { + if (!getResolvedRepoSource().equals(other.getResolvedRepoSource())) 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 (hasResolvedStorageSource()) { + hash = (37 * hash) + RESOLVED_STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedStorageSource().hashCode(); + } + if (hasResolvedRepoSource()) { + hash = (37 * hash) + RESOLVED_REPO_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedRepoSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.SourceProvenance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SourceProvenance 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.v2.SourceProvenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SourceProvenance 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.v2.SourceProvenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.SourceProvenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.SourceProvenance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SourceProvenance 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.v2.SourceProvenance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SourceProvenance 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.v2.SourceProvenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.SourceProvenance 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.v2.SourceProvenance 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; + } + /** + * + * + *
+   * Provenance of the source. Ways to find the original source, or verify that
+   * some source was used for this build.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.SourceProvenance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.SourceProvenance) + com.google.cloud.functions.v2.SourceProvenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SourceProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SourceProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.SourceProvenance.class, + com.google.cloud.functions.v2.SourceProvenance.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.SourceProvenance.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 (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = null; + } else { + resolvedStorageSource_ = null; + resolvedStorageSourceBuilder_ = null; + } + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = null; + } else { + resolvedRepoSource_ = null; + resolvedRepoSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_SourceProvenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SourceProvenance getDefaultInstanceForType() { + return com.google.cloud.functions.v2.SourceProvenance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.SourceProvenance build() { + com.google.cloud.functions.v2.SourceProvenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.SourceProvenance buildPartial() { + com.google.cloud.functions.v2.SourceProvenance result = + new com.google.cloud.functions.v2.SourceProvenance(this); + if (resolvedStorageSourceBuilder_ == null) { + result.resolvedStorageSource_ = resolvedStorageSource_; + } else { + result.resolvedStorageSource_ = resolvedStorageSourceBuilder_.build(); + } + if (resolvedRepoSourceBuilder_ == null) { + result.resolvedRepoSource_ = resolvedRepoSource_; + } else { + result.resolvedRepoSource_ = resolvedRepoSourceBuilder_.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.v2.SourceProvenance) { + return mergeFrom((com.google.cloud.functions.v2.SourceProvenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.SourceProvenance other) { + if (other == com.google.cloud.functions.v2.SourceProvenance.getDefaultInstance()) return this; + if (other.hasResolvedStorageSource()) { + mergeResolvedStorageSource(other.getResolvedStorageSource()); + } + if (other.hasResolvedRepoSource()) { + mergeResolvedRepoSource(other.getResolvedRepoSource()); + } + 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.v2.SourceProvenance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.SourceProvenance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v2.StorageSource resolvedStorageSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder> + resolvedStorageSourceBuilder_; + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + public boolean hasResolvedStorageSource() { + return resolvedStorageSourceBuilder_ != null || resolvedStorageSource_ != null; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + public com.google.cloud.functions.v2.StorageSource getResolvedStorageSource() { + if (resolvedStorageSourceBuilder_ == null) { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } else { + return resolvedStorageSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + public Builder setResolvedStorageSource(com.google.cloud.functions.v2.StorageSource value) { + if (resolvedStorageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedStorageSource_ = value; + onChanged(); + } else { + resolvedStorageSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + public Builder setResolvedStorageSource( + com.google.cloud.functions.v2.StorageSource.Builder builderForValue) { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = builderForValue.build(); + onChanged(); + } else { + resolvedStorageSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + public Builder mergeResolvedStorageSource(com.google.cloud.functions.v2.StorageSource value) { + if (resolvedStorageSourceBuilder_ == null) { + if (resolvedStorageSource_ != null) { + resolvedStorageSource_ = + com.google.cloud.functions.v2.StorageSource.newBuilder(resolvedStorageSource_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedStorageSource_ = value; + } + onChanged(); + } else { + resolvedStorageSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + public Builder clearResolvedStorageSource() { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = null; + onChanged(); + } else { + resolvedStorageSource_ = null; + resolvedStorageSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + public com.google.cloud.functions.v2.StorageSource.Builder getResolvedStorageSourceBuilder() { + + onChanged(); + return getResolvedStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + public com.google.cloud.functions.v2.StorageSourceOrBuilder + getResolvedStorageSourceOrBuilder() { + if (resolvedStorageSourceBuilder_ != null) { + return resolvedStorageSourceBuilder_.getMessageOrBuilder(); + } else { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder> + getResolvedStorageSourceFieldBuilder() { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.StorageSource, + com.google.cloud.functions.v2.StorageSource.Builder, + com.google.cloud.functions.v2.StorageSourceOrBuilder>( + getResolvedStorageSource(), getParentForChildren(), isClean()); + resolvedStorageSource_ = null; + } + return resolvedStorageSourceBuilder_; + } + + private com.google.cloud.functions.v2.RepoSource resolvedRepoSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.RepoSource, + com.google.cloud.functions.v2.RepoSource.Builder, + com.google.cloud.functions.v2.RepoSourceOrBuilder> + resolvedRepoSourceBuilder_; + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + public boolean hasResolvedRepoSource() { + return resolvedRepoSourceBuilder_ != null || resolvedRepoSource_ != null; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + public com.google.cloud.functions.v2.RepoSource getResolvedRepoSource() { + if (resolvedRepoSourceBuilder_ == null) { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } else { + return resolvedRepoSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + public Builder setResolvedRepoSource(com.google.cloud.functions.v2.RepoSource value) { + if (resolvedRepoSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedRepoSource_ = value; + onChanged(); + } else { + resolvedRepoSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + public Builder setResolvedRepoSource( + com.google.cloud.functions.v2.RepoSource.Builder builderForValue) { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = builderForValue.build(); + onChanged(); + } else { + resolvedRepoSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + public Builder mergeResolvedRepoSource(com.google.cloud.functions.v2.RepoSource value) { + if (resolvedRepoSourceBuilder_ == null) { + if (resolvedRepoSource_ != null) { + resolvedRepoSource_ = + com.google.cloud.functions.v2.RepoSource.newBuilder(resolvedRepoSource_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedRepoSource_ = value; + } + onChanged(); + } else { + resolvedRepoSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + public Builder clearResolvedRepoSource() { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = null; + onChanged(); + } else { + resolvedRepoSource_ = null; + resolvedRepoSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + public com.google.cloud.functions.v2.RepoSource.Builder getResolvedRepoSourceBuilder() { + + onChanged(); + return getResolvedRepoSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + public com.google.cloud.functions.v2.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder() { + if (resolvedRepoSourceBuilder_ != null) { + return resolvedRepoSourceBuilder_.getMessageOrBuilder(); + } else { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.RepoSource, + com.google.cloud.functions.v2.RepoSource.Builder, + com.google.cloud.functions.v2.RepoSourceOrBuilder> + getResolvedRepoSourceFieldBuilder() { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.RepoSource, + com.google.cloud.functions.v2.RepoSource.Builder, + com.google.cloud.functions.v2.RepoSourceOrBuilder>( + getResolvedRepoSource(), getParentForChildren(), isClean()); + resolvedRepoSource_ = null; + } + return resolvedRepoSourceBuilder_; + } + + @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.v2.SourceProvenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.SourceProvenance) + private static final com.google.cloud.functions.v2.SourceProvenance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.SourceProvenance(); + } + + public static com.google.cloud.functions.v2.SourceProvenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceProvenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceProvenance(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.v2.SourceProvenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenanceOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenanceOrBuilder.java new file mode 100644 index 00000000..e83241b0 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/SourceProvenanceOrBuilder.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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface SourceProvenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.SourceProvenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + boolean hasResolvedStorageSource(); + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + com.google.cloud.functions.v2.StorageSource getResolvedStorageSource(); + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2.StorageSource resolved_storage_source = 1; + */ + com.google.cloud.functions.v2.StorageSourceOrBuilder getResolvedStorageSourceOrBuilder(); + + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + boolean hasResolvedRepoSource(); + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + com.google.cloud.functions.v2.RepoSource getResolvedRepoSource(); + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2.RepoSource resolved_repo_source = 2; + */ + com.google.cloud.functions.v2.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Stage.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Stage.java new file mode 100644 index 00000000..3296dd6e --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Stage.java @@ -0,0 +1,2214 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Each Stage of the deployment process
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.Stage} + */ +public final class Stage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.Stage) + StageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Stage.newBuilder() to construct. + private Stage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Stage() { + name_ = 0; + message_ = ""; + state_ = 0; + resource_ = ""; + resourceUri_ = ""; + stateMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Stage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Stage( + 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 8: + { + int rawValue = input.readEnum(); + + name_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + resource_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUri_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stateMessages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stateMessages_.add( + input.readMessage( + com.google.cloud.functions.v2.StateMessage.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Stage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Stage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.Stage.class, + com.google.cloud.functions.v2.Stage.Builder.class); + } + + /** + * + * + *
+   * Possible names for a Stage
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.Stage.Name} + */ + public enum Name implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid name.
+     * 
+ * + * NAME_UNSPECIFIED = 0; + */ + NAME_UNSPECIFIED(0), + /** + * + * + *
+     * Artifact Regsitry Stage
+     * 
+ * + * ARTIFACT_REGISTRY = 1; + */ + ARTIFACT_REGISTRY(1), + /** + * + * + *
+     * Build Stage
+     * 
+ * + * BUILD = 2; + */ + BUILD(2), + /** + * + * + *
+     * Service Stage
+     * 
+ * + * SERVICE = 3; + */ + SERVICE(3), + /** + * + * + *
+     * Trigger Stage
+     * 
+ * + * TRIGGER = 4; + */ + TRIGGER(4), + /** + * + * + *
+     * Service Rollback Stage
+     * 
+ * + * SERVICE_ROLLBACK = 5; + */ + SERVICE_ROLLBACK(5), + /** + * + * + *
+     * Trigger Rollback Stage
+     * 
+ * + * TRIGGER_ROLLBACK = 6; + */ + TRIGGER_ROLLBACK(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid name.
+     * 
+ * + * NAME_UNSPECIFIED = 0; + */ + public static final int NAME_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Artifact Regsitry Stage
+     * 
+ * + * ARTIFACT_REGISTRY = 1; + */ + public static final int ARTIFACT_REGISTRY_VALUE = 1; + /** + * + * + *
+     * Build Stage
+     * 
+ * + * BUILD = 2; + */ + public static final int BUILD_VALUE = 2; + /** + * + * + *
+     * Service Stage
+     * 
+ * + * SERVICE = 3; + */ + public static final int SERVICE_VALUE = 3; + /** + * + * + *
+     * Trigger Stage
+     * 
+ * + * TRIGGER = 4; + */ + public static final int TRIGGER_VALUE = 4; + /** + * + * + *
+     * Service Rollback Stage
+     * 
+ * + * SERVICE_ROLLBACK = 5; + */ + public static final int SERVICE_ROLLBACK_VALUE = 5; + /** + * + * + *
+     * Trigger Rollback Stage
+     * 
+ * + * TRIGGER_ROLLBACK = 6; + */ + public static final int TRIGGER_ROLLBACK_VALUE = 6; + + 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 Name 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 Name forNumber(int value) { + switch (value) { + case 0: + return NAME_UNSPECIFIED; + case 1: + return ARTIFACT_REGISTRY; + case 2: + return BUILD; + case 3: + return SERVICE; + case 4: + return TRIGGER; + case 5: + return SERVICE_ROLLBACK; + case 6: + return TRIGGER_ROLLBACK; + 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 Name findValueByNumber(int number) { + return Name.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.v2.Stage.getDescriptor().getEnumTypes().get(0); + } + + private static final Name[] VALUES = values(); + + public static Name 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 Name(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.Stage.Name) + } + + /** + * + * + *
+   * Possible states for a Stage
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.Stage.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Stage has not started.
+     * 
+ * + * NOT_STARTED = 1; + */ + NOT_STARTED(1), + /** + * + * + *
+     * Stage is in progress.
+     * 
+ * + * IN_PROGRESS = 2; + */ + IN_PROGRESS(2), + /** + * + * + *
+     * Stage has completed.
+     * 
+ * + * COMPLETE = 3; + */ + COMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stage has not started.
+     * 
+ * + * NOT_STARTED = 1; + */ + public static final int NOT_STARTED_VALUE = 1; + /** + * + * + *
+     * Stage is in progress.
+     * 
+ * + * IN_PROGRESS = 2; + */ + public static final int IN_PROGRESS_VALUE = 2; + /** + * + * + *
+     * Stage has completed.
+     * 
+ * + * COMPLETE = 3; + */ + public static final int COMPLETE_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 State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return NOT_STARTED; + case 2: + return IN_PROGRESS; + case 3: + return COMPLETE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2.Stage.getDescriptor().getEnumTypes().get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.Stage.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private int name_; + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + @java.lang.Override + public int getNameValue() { + return name_; + } + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return The name. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Stage.Name getName() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Stage.Name result = + com.google.cloud.functions.v2.Stage.Name.valueOf(name_); + return result == null ? com.google.cloud.functions.v2.Stage.Name.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Stage.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Stage.State result = + com.google.cloud.functions.v2.Stage.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2.Stage.State.UNRECOGNIZED : result; + } + + public static final int RESOURCE_FIELD_NUMBER = 4; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @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; + } + } + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @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 RESOURCE_URI_FIELD_NUMBER = 5; + private volatile java.lang.Object resourceUri_; + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + @java.lang.Override + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + 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(); + resourceUri_ = s; + return s; + } + } + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_MESSAGES_FIELD_NUMBER = 6; + private java.util.List stateMessages_; + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + @java.lang.Override + public java.util.List getStateMessagesList() { + return stateMessages_; + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + @java.lang.Override + public java.util.List + getStateMessagesOrBuilderList() { + return stateMessages_; + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + @java.lang.Override + public int getStateMessagesCount() { + return stateMessages_.size(); + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage getStateMessages(int index) { + return stateMessages_.get(index); + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder(int index) { + return stateMessages_.get(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 { + if (name_ != com.google.cloud.functions.v2.Stage.Name.NAME_UNSPECIFIED.getNumber()) { + output.writeEnum(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (state_ != com.google.cloud.functions.v2.Stage.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resourceUri_); + } + for (int i = 0; i < stateMessages_.size(); i++) { + output.writeMessage(6, stateMessages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (name_ != com.google.cloud.functions.v2.Stage.Name.NAME_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (state_ != com.google.cloud.functions.v2.Stage.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, resourceUri_); + } + for (int i = 0; i < stateMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, stateMessages_.get(i)); + } + 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.v2.Stage)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.Stage other = (com.google.cloud.functions.v2.Stage) obj; + + if (name_ != other.name_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (state_ != other.state_) return false; + if (!getResource().equals(other.getResource())) return false; + if (!getResourceUri().equals(other.getResourceUri())) return false; + if (!getStateMessagesList().equals(other.getStateMessagesList())) 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) + name_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + RESOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getResourceUri().hashCode(); + if (getStateMessagesCount() > 0) { + hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getStateMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.Stage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Stage 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.v2.Stage parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Stage 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.v2.Stage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.Stage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.Stage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Stage 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.v2.Stage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Stage 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.v2.Stage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.Stage 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.v2.Stage 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; + } + /** + * + * + *
+   * Each Stage of the deployment process
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.Stage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.Stage) + com.google.cloud.functions.v2.StageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Stage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Stage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.Stage.class, + com.google.cloud.functions.v2.Stage.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.Stage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStateMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = 0; + + message_ = ""; + + state_ = 0; + + resource_ = ""; + + resourceUri_ = ""; + + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_Stage_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.Stage getDefaultInstanceForType() { + return com.google.cloud.functions.v2.Stage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.Stage build() { + com.google.cloud.functions.v2.Stage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.Stage buildPartial() { + com.google.cloud.functions.v2.Stage result = new com.google.cloud.functions.v2.Stage(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.message_ = message_; + result.state_ = state_; + result.resource_ = resource_; + result.resourceUri_ = resourceUri_; + if (stateMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stateMessages_ = stateMessages_; + } else { + result.stateMessages_ = stateMessagesBuilder_.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.v2.Stage) { + return mergeFrom((com.google.cloud.functions.v2.Stage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.Stage other) { + if (other == com.google.cloud.functions.v2.Stage.getDefaultInstance()) return this; + if (other.name_ != 0) { + setNameValue(other.getNameValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getResourceUri().isEmpty()) { + resourceUri_ = other.resourceUri_; + onChanged(); + } + if (stateMessagesBuilder_ == null) { + if (!other.stateMessages_.isEmpty()) { + if (stateMessages_.isEmpty()) { + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStateMessagesIsMutable(); + stateMessages_.addAll(other.stateMessages_); + } + onChanged(); + } + } else { + if (!other.stateMessages_.isEmpty()) { + if (stateMessagesBuilder_.isEmpty()) { + stateMessagesBuilder_.dispose(); + stateMessagesBuilder_ = null; + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + stateMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStateMessagesFieldBuilder() + : null; + } else { + stateMessagesBuilder_.addAllMessages(other.stateMessages_); + } + } + } + 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.v2.Stage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.Stage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int name_ = 0; + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + @java.lang.Override + public int getNameValue() { + return name_; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @param value The enum numeric value on the wire for name to set. + * @return This builder for chaining. + */ + public Builder setNameValue(int value) { + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return The name. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Stage.Name getName() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Stage.Name result = + com.google.cloud.functions.v2.Stage.Name.valueOf(name_); + return result == null ? com.google.cloud.functions.v2.Stage.Name.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(com.google.cloud.functions.v2.Stage.Name value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Stage.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.Stage.State result = + com.google.cloud.functions.v2.Stage.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2.Stage.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.functions.v2.Stage.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @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; + } + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @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; + } + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @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; + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @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 resourceUri_ = ""; + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @param value The resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return This builder for chaining. + */ + public Builder clearResourceUri() { + + resourceUri_ = getDefaultInstance().getResourceUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @param value The bytes for resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceUri_ = value; + onChanged(); + return this; + } + + private java.util.List stateMessages_ = + java.util.Collections.emptyList(); + + private void ensureStateMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stateMessages_ = + new java.util.ArrayList(stateMessages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.StateMessage, + com.google.cloud.functions.v2.StateMessage.Builder, + com.google.cloud.functions.v2.StateMessageOrBuilder> + stateMessagesBuilder_; + + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public java.util.List getStateMessagesList() { + if (stateMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stateMessages_); + } else { + return stateMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public int getStateMessagesCount() { + if (stateMessagesBuilder_ == null) { + return stateMessages_.size(); + } else { + return stateMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2.StateMessage getStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder setStateMessages(int index, com.google.cloud.functions.v2.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.set(index, value); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder addStateMessages(com.google.cloud.functions.v2.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder addStateMessages(int index, com.google.cloud.functions.v2.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(index, value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + com.google.cloud.functions.v2.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder addAllStateMessages( + java.lang.Iterable values) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stateMessages_); + onChanged(); + } else { + stateMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder clearStateMessages() { + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public Builder removeStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.remove(index); + onChanged(); + } else { + stateMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2.StateMessage.Builder getStateMessagesBuilder(int index) { + return getStateMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public java.util.List + getStateMessagesOrBuilderList() { + if (stateMessagesBuilder_ != null) { + return stateMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stateMessages_); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2.StateMessage.Builder addStateMessagesBuilder() { + return getStateMessagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2.StateMessage.Builder addStateMessagesBuilder(int index) { + return getStateMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + public java.util.List + getStateMessagesBuilderList() { + return getStateMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.StateMessage, + com.google.cloud.functions.v2.StateMessage.Builder, + com.google.cloud.functions.v2.StateMessageOrBuilder> + getStateMessagesFieldBuilder() { + if (stateMessagesBuilder_ == null) { + stateMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2.StateMessage, + com.google.cloud.functions.v2.StateMessage.Builder, + com.google.cloud.functions.v2.StateMessageOrBuilder>( + stateMessages_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + stateMessages_ = null; + } + return stateMessagesBuilder_; + } + + @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.v2.Stage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.Stage) + private static final com.google.cloud.functions.v2.Stage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.Stage(); + } + + public static com.google.cloud.functions.v2.Stage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Stage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Stage(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.v2.Stage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StageOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StageOrBuilder.java new file mode 100644 index 00000000..f99ae3ba --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StageOrBuilder.java @@ -0,0 +1,202 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface StageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.Stage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + int getNameValue(); + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2.Stage.Name name = 1; + * + * @return The name. + */ + com.google.cloud.functions.v2.Stage.Name getName(); + + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2.Stage.State state = 3; + * + * @return The state. + */ + com.google.cloud.functions.v2.Stage.State getState(); + + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + java.lang.String getResourceUri(); + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + com.google.protobuf.ByteString getResourceUriBytes(); + + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + java.util.List getStateMessagesList(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + com.google.cloud.functions.v2.StateMessage getStateMessages(int index); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + int getStateMessagesCount(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + java.util.List + getStateMessagesOrBuilderList(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2.StateMessage state_messages = 6; + */ + com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessage.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessage.java new file mode 100644 index 00000000..f7f6eaeb --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessage.java @@ -0,0 +1,1150 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Informational messages about the state of the Cloud Function or Operation.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.StateMessage} + */ +public final class StateMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.StateMessage) + StateMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateMessage.newBuilder() to construct. + private StateMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StateMessage() { + severity_ = 0; + type_ = ""; + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StateMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StateMessage( + 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 8: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StateMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StateMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.StateMessage.class, + com.google.cloud.functions.v2.StateMessage.Builder.class); + } + + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.StateMessage.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+     * ERROR-level severity.
+     * 
+ * + * ERROR = 1; + */ + ERROR(1), + /** + * + * + *
+     * WARNING-level severity.
+     * 
+ * + * WARNING = 2; + */ + WARNING(2), + /** + * + * + *
+     * INFO-level severity.
+     * 
+ * + * INFO = 3; + */ + INFO(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * ERROR-level severity.
+     * 
+ * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + /** + * + * + *
+     * WARNING-level severity.
+     * 
+ * + * WARNING = 2; + */ + public static final int WARNING_VALUE = 2; + /** + * + * + *
+     * INFO-level severity.
+     * 
+ * + * INFO = 3; + */ + public static final int INFO_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 Severity 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 Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return ERROR; + case 2: + return WARNING; + case 3: + return INFO; + 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 Severity findValueByNumber(int number) { + return Severity.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.v2.StateMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity 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 Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.StateMessage.Severity) + } + + public static final int SEVERITY_FIELD_NUMBER = 1; + private int severity_; + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.StateMessage.Severity result = + com.google.cloud.functions.v2.StateMessage.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.functions.v2.StateMessage.Severity.UNRECOGNIZED + : result; + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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 (severity_ + != com.google.cloud.functions.v2.StateMessage.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (severity_ + != com.google.cloud.functions.v2.StateMessage.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + 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.v2.StateMessage)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.StateMessage other = + (com.google.cloud.functions.v2.StateMessage) obj; + + if (severity_ != other.severity_) return false; + if (!getType().equals(other.getType())) return false; + if (!getMessage().equals(other.getMessage())) 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) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.StateMessage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.StateMessage 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.v2.StateMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.StateMessage 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.v2.StateMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.StateMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.StateMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.StateMessage 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.v2.StateMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.StateMessage 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.v2.StateMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.StateMessage 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.v2.StateMessage 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; + } + /** + * + * + *
+   * Informational messages about the state of the Cloud Function or Operation.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.StateMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.StateMessage) + com.google.cloud.functions.v2.StateMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StateMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StateMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.StateMessage.class, + com.google.cloud.functions.v2.StateMessage.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.StateMessage.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(); + severity_ = 0; + + type_ = ""; + + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StateMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage getDefaultInstanceForType() { + return com.google.cloud.functions.v2.StateMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage build() { + com.google.cloud.functions.v2.StateMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage buildPartial() { + com.google.cloud.functions.v2.StateMessage result = + new com.google.cloud.functions.v2.StateMessage(this); + result.severity_ = severity_; + result.type_ = type_; + result.message_ = message_; + 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.v2.StateMessage) { + return mergeFrom((com.google.cloud.functions.v2.StateMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.StateMessage other) { + if (other == com.google.cloud.functions.v2.StateMessage.getDefaultInstance()) return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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.v2.StateMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.StateMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int severity_ = 0; + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.functions.v2.StateMessage.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2.StateMessage.Severity result = + com.google.cloud.functions.v2.StateMessage.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.functions.v2.StateMessage.Severity.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.functions.v2.StateMessage.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = 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.v2.StateMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.StateMessage) + private static final com.google.cloud.functions.v2.StateMessage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.StateMessage(); + } + + public static com.google.cloud.functions.v2.StateMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StateMessage(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.v2.StateMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessageOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessageOrBuilder.java new file mode 100644 index 00000000..6d7f25bb --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StateMessageOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface StateMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.StateMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + com.google.cloud.functions.v2.StateMessage.Severity getSeverity(); + + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSource.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSource.java new file mode 100644 index 00000000..27d3a966 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSource.java @@ -0,0 +1,937 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Location of the source in an archive file in Google Cloud Storage.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.StorageSource} + */ +public final class StorageSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.StorageSource) + StorageSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use StorageSource.newBuilder() to construct. + private StorageSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StorageSource() { + bucket_ = ""; + object_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StorageSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StorageSource( + 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(); + + bucket_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + object_ = s; + break; + } + case 24: + { + generation_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StorageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StorageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.StorageSource.class, + com.google.cloud.functions.v2.StorageSource.Builder.class); + } + + public static final int BUCKET_FIELD_NUMBER = 1; + private volatile java.lang.Object bucket_; + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + 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(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object object_; + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + @java.lang.Override + public java.lang.String getObject() { + java.lang.Object ref = object_; + 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(); + object_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_; + /** + * + * + *
+   * Google Cloud Storage generation for the object. If the generation is
+   * omitted, the latest generation will be used.
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + 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.v2.StorageSource)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.StorageSource other = + (com.google.cloud.functions.v2.StorageSource) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getObject().equals(other.getObject())) return false; + if (getGeneration() != other.getGeneration()) 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) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2.StorageSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.StorageSource 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.v2.StorageSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.StorageSource 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.v2.StorageSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.StorageSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2.StorageSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.StorageSource 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.v2.StorageSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.StorageSource 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.v2.StorageSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.StorageSource 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.v2.StorageSource 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; + } + /** + * + * + *
+   * Location of the source in an archive file in Google Cloud Storage.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2.StorageSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.StorageSource) + com.google.cloud.functions.v2.StorageSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StorageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StorageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.StorageSource.class, + com.google.cloud.functions.v2.StorageSource.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.StorageSource.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(); + bucket_ = ""; + + object_ = ""; + + generation_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_StorageSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource getDefaultInstanceForType() { + return com.google.cloud.functions.v2.StorageSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource build() { + com.google.cloud.functions.v2.StorageSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.StorageSource buildPartial() { + com.google.cloud.functions.v2.StorageSource result = + new com.google.cloud.functions.v2.StorageSource(this); + result.bucket_ = bucket_; + result.object_ = object_; + result.generation_ = generation_; + 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.v2.StorageSource) { + return mergeFrom((com.google.cloud.functions.v2.StorageSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.StorageSource other) { + if (other == com.google.cloud.functions.v2.StorageSource.getDefaultInstance()) return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + onChanged(); + } + if (!other.getObject().isEmpty()) { + object_ = other.object_; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + 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.v2.StorageSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2.StorageSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object bucket_ = ""; + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bucket_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + + bucket_ = getDefaultInstance().getBucket(); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bucket_ = value; + onChanged(); + return this; + } + + private java.lang.Object object_ = ""; + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return The object. + */ + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @param value The object to set. + * @return This builder for chaining. + */ + public Builder setObject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + object_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return This builder for chaining. + */ + public Builder clearObject() { + + object_ = getDefaultInstance().getObject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @param value The bytes for object to set. + * @return This builder for chaining. + */ + public Builder setObjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + object_ = value; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + + generation_ = 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.v2.StorageSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.StorageSource) + private static final com.google.cloud.functions.v2.StorageSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.StorageSource(); + } + + public static com.google.cloud.functions.v2.StorageSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StorageSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StorageSource(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.v2.StorageSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSourceOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSourceOrBuilder.java new file mode 100644 index 00000000..f917b451 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/StorageSourceOrBuilder.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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface StorageSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.StorageSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + java.lang.String getObject(); + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + com.google.protobuf.ByteString getObjectBytes(); + + /** + * + * + *
+   * Google Cloud Storage generation for the object. If the generation is
+   * omitted, the latest generation will be used.
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + long getGeneration(); +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequest.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequest.java new file mode 100644 index 00000000..1076c76d --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequest.java @@ -0,0 +1,1055 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +/** + * + * + *
+ * Request for the `UpdateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2.UpdateFunctionRequest} + */ +public final class UpdateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2.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.v2.Function.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v2.Function.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 (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.UpdateFunctionRequest.class, + com.google.cloud.functions.v2.UpdateFunctionRequest.Builder.class); + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + private com.google.cloud.functions.v2.Function function_; + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v2.Function getFunction() { + return function_ == null + ? com.google.cloud.functions.v2.Function.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2.FunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (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.v2.UpdateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2.UpdateFunctionRequest other = + (com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2.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.v2.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.v2.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.v2.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.v2.UpdateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2.UpdateFunctionRequest) + com.google.cloud.functions.v2.UpdateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2.UpdateFunctionRequest.class, + com.google.cloud.functions.v2.UpdateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2.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.v2.FunctionsProto + .internal_static_google_cloud_functions_v2_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2.UpdateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2.UpdateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2.UpdateFunctionRequest build() { + com.google.cloud.functions.v2.UpdateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2.UpdateFunctionRequest buildPartial() { + com.google.cloud.functions.v2.UpdateFunctionRequest result = + new com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2.UpdateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2.UpdateFunctionRequest other) { + if (other == com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2.UpdateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v2.Function function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v2.Function getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v2.Function.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2.Function 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.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2.Function.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.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v2.Function value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v2.Function.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2.Function.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2.FunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v2.Function.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2.Function, + com.google.cloud.functions.v2.Function.Builder, + com.google.cloud.functions.v2.FunctionOrBuilder>( + 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_; + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2.UpdateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2.UpdateFunctionRequest) + private static final com.google.cloud.functions.v2.UpdateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2.UpdateFunctionRequest(); + } + + public static com.google.cloud.functions.v2.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.v2.UpdateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..16e8d11e --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/UpdateFunctionRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * 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/v2/functions.proto + +package com.google.cloud.functions.v2; + +public interface UpdateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2.UpdateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v2.Function getFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v2.FunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto b/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto new file mode 100644 index 00000000..6af26ee8 --- /dev/null +++ b/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto @@ -0,0 +1,1037 @@ +// Copyright 2022 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.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v2;functions"; +option java_multiple_files = true; +option java_outer_classname = "FunctionsProto"; +option java_package = "com.google.cloud.functions.v2"; +option objc_class_prefix = "GCF"; +option (google.api.resource_definition) = { + type: "artifactregistry.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/repositories/{repository}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/locations/{location}/builds/{build}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" +}; +option (google.api.resource_definition) = { + type: "run.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "vpcaccess.googleapis.com/Connector" + pattern: "projects/{project}/locations/{location}/connectors/{connector}" +}; +option (google.api.resource_definition) = { + type: "eventarc.googleapis.com/Trigger" + pattern: "projects/{project}/locations/{location}/triggers/{trigger}" +}; +option (google.api.resource_definition) = { + type: "eventarc.googleapis.com/Channel" + pattern: "projects/{project}/locations/{location}/channels/{channel}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// Google Cloud Functions is used to deploy functions that are executed by +// Google in response to various events. Data connected with that event is +// passed to a function as the input data. +// +// A **function** is a resource which describes a function that should be +// executed and how it is triggered. +service FunctionService { + option (google.api.default_host) = "cloudfunctions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a function with the given name from the requested project. + rpc GetFunction(GetFunctionRequest) returns (Function) { + option (google.api.http) = { + get: "/v2/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of functions that belong to the requested project. + rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/functions" + }; + option (google.api.method_signature) = "parent"; + } + + // 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: "/v2/{parent=projects/*/locations/*}/functions" + body: "function" + }; + option (google.api.method_signature) = "parent,function,function_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.functions.v2.Function" + metadata_type: "google.cloud.functions.v2.OperationMetadata" + }; + } + + // Updates existing function. + rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{function.name=projects/*/locations/*/functions/*}" + body: "function" + }; + option (google.api.method_signature) = "function,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.functions.v2.Function" + metadata_type: "google.cloud.functions.v2.OperationMetadata" + }; + } + + // 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: "/v2/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.functions.v2.OperationMetadata" + }; + } + + // 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. + // * 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` + // + // And this header SHOULD NOT be specified: + // + // * `Authorization: Bearer YOUR_TOKEN` + rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + option (google.api.http) = { + post: "/v2/{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 + // 30 minutes of 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: "/v2/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" + body: "*" + }; + } + + // Returns a list of runtimes that are supported for the requested project. + rpc ListRuntimes(ListRuntimesRequest) returns (ListRuntimesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/locations/*}/runtimes" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The environment the function is hosted on. +enum Environment { + // Unspecified + ENVIRONMENT_UNSPECIFIED = 0; + + // Gen 1 + GEN_1 = 1; + + // Gen 2 + GEN_2 = 2; +} + +// Describes a Cloud Function that contains user computation executed in +// response to an event. It encapsulates function and trigger configurations. +message Function { + option (google.api.resource) = { + type: "cloudfunctions.googleapis.com/Function" + pattern: "projects/{project}/locations/{location}/functions/{function}" + plural: "functions" + singular: "function" + }; + + // Describes the current state of the function. + enum State { + // Not specified. Invalid state. + STATE_UNSPECIFIED = 0; + + // Function has been successfully deployed and is serving. + ACTIVE = 1; + + // Function deployment failed and the function is not serving. + FAILED = 2; + + // Function is being created or updated. + DEPLOYING = 3; + + // Function is being deleted. + DELETING = 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; + } + + // A user-defined name of the function. Function names must be unique + // globally and match pattern `projects/*/locations/*/functions/*` + string name = 1; + + // Describe whether the function is gen1 or gen2. + Environment environment = 10; + + // User-provided description of a function. + string description = 2; + + // Describes the Build step of the function that builds a container from the + // given source. + BuildConfig build_config = 3; + + // Describes the Service being deployed. Currently deploys services to Cloud + // Run (fully managed). + ServiceConfig service_config = 4; + + // An Eventarc trigger managed by Google Cloud Functions that fires events in + // response to a condition in another service. + EventTrigger event_trigger = 5; + + // Output only. State of the function. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a Cloud Function. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this Cloud Function. + map labels = 8; + + // Output only. State Messages for this Cloud Function. + repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Informational messages about the state of the Cloud Function or Operation. +message StateMessage { + // Severity of the state message. + enum Severity { + // Not specified. Invalid severity. + SEVERITY_UNSPECIFIED = 0; + + // ERROR-level severity. + ERROR = 1; + + // WARNING-level severity. + WARNING = 2; + + // INFO-level severity. + INFO = 3; + } + + // Severity of the state message. + Severity severity = 1; + + // One-word CamelCase type of the state message. + string type = 2; + + // The message. + string message = 3; +} + +// Location of the source in an archive file in Google Cloud Storage. +message StorageSource { + // Google Cloud Storage bucket containing the source (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + string bucket = 1; + + // Google Cloud Storage object containing the source. + // + // This object must be a gzipped archive file (`.tar.gz`) containing source to + // build. + string object = 2; + + // Google Cloud Storage generation for the object. If the generation is + // omitted, the latest generation will be used. + int64 generation = 3; +} + +// Location of the source in a Google Cloud Source Repository. +message RepoSource { + // A revision within the Cloud Source Repository must be specified in + // one of these ways. + oneof revision { + // Regex matching branches to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string branch_name = 3; + + // Regex matching tags to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string tag_name = 4; + + // Explicit commit SHA to build. + string commit_sha = 5; + } + + // ID of the project that owns the Cloud Source Repository. If omitted, the + // project ID requesting the build is assumed. + string project_id = 1; + + // Name of the Cloud Source Repository. + string repo_name = 2; + + // Directory, relative to the source root, in which to run the build. + // + // This must be a relative path. If a step's `dir` is specified and is an + // absolute path, this value is ignored for that step's execution. + // eg. helloworld (no leading slash allowed) + string dir = 6; + + // Only trigger a build if the revision regex does NOT match the revision + // regex. + bool invert_regex = 7; +} + +// The location of the function source code. +message Source { + // Location of the source. + // At least one source needs to be provided for the deployment to succeed. + oneof source { + // If provided, get the source from this location in Google Cloud Storage. + StorageSource storage_source = 1; + + // If provided, get the source from this location in a Cloud Source + // Repository. + RepoSource repo_source = 2; + } +} + +// Provenance of the source. Ways to find the original source, or verify that +// some source was used for this build. +message SourceProvenance { + // A copy of the build's `source.storage_source`, if exists, with any + // generations resolved. + StorageSource resolved_storage_source = 1; + + // A copy of the build's `source.repo_source`, if exists, with any + // revisions resolved. + RepoSource resolved_repo_source = 2; +} + +// Describes the Build step of the function that builds a container from the +// given source. +message BuildConfig { + // Output only. The Cloud Build name of the latest successful deployment of the + // function. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // 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](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime). + string runtime = 2; + + // 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 = 3; + + // The location of the function source code. + Source source = 4; + + // Output only. A permanent fixed identifier for source. + SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the Cloud Build Custom Worker Pool that should be used to build the + // function. The format of this field is + // `projects/{project}/locations/{region}/workerPools/{workerPool}` where + // {project} and {region} are the project id and region respectively where the + // worker pool is defined and {workerPool} is the short name of the worker + // pool. + // + // If the project id is not the same as the function, then the Cloud + // Functions Service Agent + // (service-@gcf-admin-robot.iam.gserviceaccount.com) must be + // granted the role Cloud Build Custom Workers Builder + // (roles/cloudbuild.customworkers.builder) in the project. + string worker_pool = 5 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // User-provided build-time environment variables for the function + map environment_variables = 6; + + // Optional. User managed repository created in Artifact Registry optionally with a + // customer managed encryption key. This is the repository to which the + // function docker image will be pushed after it is built by Cloud Build. + // If unspecified, GCF will create and use a repository named 'gcf-artifacts' + // for every deployed region. + // + // It must match the pattern + // `projects/{project}/locations/{location}/repositories/{repository}`. + // + // Cross-project repositories are not supported. + // Cross-location repositories are not supported. + // Repository format must be 'DOCKER'. + string docker_repository = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "artifactregistry.googleapis.com/Repository" + } + ]; +} + +// Describes the Service being deployed. +// Currently Supported : Cloud Run (fully managed). +message ServiceConfig { + // 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; + } + + // Output only. Name of the service associated with a Function. + // The format of this field is + // `projects/{project}/locations/{region}/services/{service}` + string service = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "run.googleapis.com/Service" + } + ]; + + // 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. + int32 timeout_seconds = 2; + + // The amount of memory available for a function. + // Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is + // supplied the value is interpreted as bytes. + // See + // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + // a full description. + string available_memory = 13; + + // Environment variables that shall be available during function execution. + map environment_variables = 4; + + // The limit on the maximum number of function instances that may coexist at a + // given time. + // + // In some cases, such as rapid traffic surges, Cloud Functions may, for a + // short period of time, create more instances than the specified max + // instances limit. If your function cannot tolerate this temporary behavior, + // you may want to factor in a safety margin and set a lower max instances + // value than your function can tolerate. + // + // See the [Max + // Instances](https://cloud.google.com/functions/docs/max-instances) Guide for + // more details. + int32 max_instance_count = 5; + + // The limit on the minimum number of function instances that may coexist at a + // given time. + // + // Function instances are kept in idle state for a short period after they + // finished executing the request to reduce cold start time for subsequent + // requests. Setting a minimum instance count will ensure that the given + // number of instances are kept running in idle state always. This can help + // with cold start times when jump in incoming request count occurs after the + // idle instance would have been stopped in the default case. + int32 min_instance_count = 12; + + // The Serverless VPC Access connector that this cloud function can connect + // to. The format of this field is `projects/*/locations/*/connectors/*`. + string vpc_connector = 6 [(google.api.resource_reference) = { + type: "vpcaccess.googleapis.com/Connector" + }]; + + // The egress settings for the connector, controlling what traffic is diverted + // through it. + VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + + // The ingress settings for the function, controlling what traffic can reach + // it. + IngressSettings ingress_settings = 8; + + // Output only. URI of the Service deployed. + string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email of the service's service account. If empty, defaults to + // `{project_number}-compute@developer.gserviceaccount.com`. + string service_account_email = 10; + + // Whether 100% of traffic is routed to the latest revision. + // On CreateFunction and UpdateFunction, when set to true, the revision being + // deployed will serve 100% of traffic, ignoring any traffic split settings, + // if any. On GetFunction, true will be returned if the latest revision is + // serving 100% of traffic. + bool all_traffic_on_latest_revision = 16; + + // Secret environment variables configuration. + repeated SecretEnvVar secret_environment_variables = 17; + + // Secret volumes configuration. + repeated SecretVolume secret_volumes = 19; + + // Output only. The name of service revision. + string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for a secret environment variable. It has the information +// necessary to fetch the secret value from secret manager and expose it as an +// environment variable. +message SecretEnvVar { + // Name of the environment variable. + string key = 1; + + // Project identifier (preferably project number but can also be the + // project ID) of the project that contains the secret. If not set, it is + // assumed that the secret is in the same project as the function. + string project_id = 2; + + // Name of the secret in secret manager (not the full resource name). + string secret = 3; + + // Version of the secret (version number or the string 'latest'). It is + // recommended to use a numeric version for secret environment variables as + // any updates to the secret value is not reflected until new instances + // start. + string version = 4; +} + +// Configuration for a secret volume. It has the information necessary to fetch +// the secret value from secret manager and make it available as files mounted +// at the requested paths within the application container. +message SecretVolume { + // Configuration for a single version. + message SecretVersion { + // Version of the secret (version number or the string 'latest'). It is + // preferable to use `latest` version with secret volumes as secret value + // changes are reflected immediately. + string version = 1; + + // Relative path of the file under the mount path where the secret value for + // this version will be fetched and made available. For example, setting the + // mount_path as '/etc/secrets' and path as `secret_foo` would mount the + // secret value file at `/etc/secrets/secret_foo`. + string path = 2; + } + + // The path within the container to mount the secret volume. For example, + // setting the mount_path as `/etc/secrets` would mount the secret value files + // under the `/etc/secrets` directory. This directory will also be completely + // shadowed and unavailable to mount any other secrets. + // Recommended mount path: /etc/secrets + string mount_path = 1; + + // Project identifier (preferably project number but can also be the project + // ID) of the project that contains the secret. If not set, it is + // assumed that the secret is in the same project as the function. + string project_id = 2; + + // Name of the secret in secret manager (not the full resource name). + string secret = 3; + + // List of secret versions to mount for this secret. If empty, the `latest` + // version of the secret will be made available in a file named after the + // secret under the mount point. + repeated SecretVersion versions = 4; +} + +// Describes EventTrigger, used to request events to be sent from another +// service. +message EventTrigger { + // Describes the retry policy in case of function's execution failure. + // Retried execution is charged as any other execution. + enum RetryPolicy { + // Not specified. + RETRY_POLICY_UNSPECIFIED = 0; + + // Do not retry. + RETRY_POLICY_DO_NOT_RETRY = 1; + + // Retry on any failure, retry up to 7 days with an exponential backoff + // (capped at 10 seconds). + RETRY_POLICY_RETRY = 2; + } + + // Output only. The resource name of the Eventarc trigger. The format of this field is + // `projects/{project}/locations/{region}/triggers/{trigger}`. + string trigger = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Trigger" + } + ]; + + // The region that the trigger will be in. The trigger will only receive + // events originating in this region. It can be the same + // region as the function, a different region or multi-region, or the global + // region. If not provided, defaults to the same region as the function. + string trigger_region = 2; + + // Required. The type of event to observe. For example: + // `google.cloud.audit.log.v1.written` or + // `google.cloud.pubsub.topic.v1.messagePublished`. + string event_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Criteria used to filter events. + repeated EventFilter event_filters = 4; + + // Optional. The name of a Pub/Sub topic in the same project that will be used + // as the transport topic for the event delivery. Format: + // `projects/{project}/topics/{topic}`. + // + // This is only valid for events of type + // `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here + // will not be deleted at function deletion. + string pubsub_topic = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + } + ]; + + // Optional. The email of the trigger's service account. The service account must have + // permission to invoke Cloud Run services, the permission is + // `run.routes.invoke`. + // If empty, defaults to the Compute Engine default service account: + // `{project_number}-compute@developer.gserviceaccount.com`. + string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them). + RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the channel associated with the trigger in + // `projects/{project}/locations/{location}/channels/{channel}` format. + // You must provide a channel to receive events from Eventarc SaaS partners. + string channel = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Channel" + } + ]; +} + +// Filters events based on exact matches on the CloudEvents attributes. +message EventFilter { + // Required. The name of a CloudEvents attribute. + string attribute = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value for the attribute. + string value = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The operator used for matching the events with the value of the + // filter. If not specified, only events that have an exact key-value pair + // specified in the filter are matched. The only allowed value is + // `match-path-pattern`. + string operator = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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/Function" + } + ]; +} + +// Request for the `ListFunctions` method. +message ListFunctionsRequest { + // Required. 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.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudfunctions.googleapis.com/Function" + } + ]; + + // 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; + + // The filter for Functions that match the filter expression, + // following the syntax outlined in https://google.aip.dev/160. + string filter = 4; + + // The sorting order of the resources returned. Value should be a comma + // separated list of fields. The default sorting oder is ascending. + // See https://google.aip.dev/132#ordering. + string order_by = 5; +} + +// Response for the `ListFunctions` method. +message ListFunctionsResponse { + // The functions that match the request. + repeated Function functions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. The response does not include any + // functions from these locations. + repeated string unreachable = 3; +} + +// 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 parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Function to be created. + Function function = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the function, which will become the final component of + // the function's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string function_id = 3; +} + +// Request for the `UpdateFunction` method. +message UpdateFunctionRequest { + // Required. New version of the function. + Function function = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If no field mask is provided, all provided fields in the request will be + // updated. + google.protobuf.FieldMask update_mask = 2; +} + +// 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/Function" + } + ]; +} + +// Request of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlRequest { + // Required. The project and location in which the Google Cloud Storage signed URL + // should be generated, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// 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; + + // The location of the source code in the upload bucket. + // + // Once the archive is uploaded using the `upload_url` use this field to + // set the `function.build_config.source.storage_source` + // during CreateFunction and UpdateFunction. + // + // Generation defaults to 0, as Cloud Storage provides a new generation only + // upon uploading a new object or version of an object. + StorageSource storage_source = 2; +} + +// Request of `GenerateDownloadUrl` method. +message GenerateDownloadUrlRequest { + // Required. The name of function for which source code Google Cloud Storage signed + // URL should be generated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// 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; +} + +// Request for the `ListRuntimes` method. +message ListRuntimesRequest { + // Required. The project and location from which the runtimes should be listed, + // specified in the format `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The filter for Runtimes that match the filter expression, + // following the syntax outlined in https://google.aip.dev/160. + string filter = 2; +} + +// Response for the `ListRuntimes` method. +message ListRuntimesResponse { + // Describes a runtime and any special information (e.g., deprecation status) + // related to it. + message Runtime { + // The name of the runtime, e.g., 'go113', 'nodejs12', etc. + string name = 1; + + // The user facing name, eg 'Go 1.13', 'Node.js 12', etc. + string display_name = 5; + + // The stage of life this runtime is in, e.g., BETA, GA, etc. + RuntimeStage stage = 2; + + // Warning messages, e.g., a deprecation warning. + repeated string warnings = 3; + + // The environment for the runtime. + Environment environment = 4; + } + + // The various stages that a runtime can be in. + enum RuntimeStage { + // Not specified. + RUNTIME_STAGE_UNSPECIFIED = 0; + + // The runtime is in development. + DEVELOPMENT = 1; + + // The runtime is in the Alpha stage. + ALPHA = 2; + + // The runtime is in the Beta stage. + BETA = 3; + + // The runtime is generally available. + GA = 4; + + // The runtime is deprecated. + DEPRECATED = 5; + + // The runtime is no longer supported. + DECOMMISSIONED = 6; + } + + // The runtimes that match the request. + repeated Runtime runtimes = 1; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6; + + // API version used to start the operation. + string api_version = 7; + + // The original request that started the operation. + google.protobuf.Any request_resource = 8; + + // Mechanism for reporting in-progress stages + repeated Stage stages = 9; +} + +// Each Stage of the deployment process +message Stage { + // Possible names for a Stage + enum Name { + // Not specified. Invalid name. + NAME_UNSPECIFIED = 0; + + // Artifact Regsitry Stage + ARTIFACT_REGISTRY = 1; + + // Build Stage + BUILD = 2; + + // Service Stage + SERVICE = 3; + + // Trigger Stage + TRIGGER = 4; + + // Service Rollback Stage + SERVICE_ROLLBACK = 5; + + // Trigger Rollback Stage + TRIGGER_ROLLBACK = 6; + } + + // Possible states for a Stage + enum State { + // Not specified. Invalid state. + STATE_UNSPECIFIED = 0; + + // Stage has not started. + NOT_STARTED = 1; + + // Stage is in progress. + IN_PROGRESS = 2; + + // Stage has completed. + COMPLETE = 3; + } + + // Name of the Stage. This will be unique for each Stage. + Name name = 1; + + // Message describing the Stage + string message = 2; + + // Current state of the Stage + State state = 3; + + // Resource of the Stage + string resource = 4; + + // Link to the current Stage resource + string resource_uri = 5; + + // State messages from the current Stage. + repeated StateMessage state_messages = 6; +} diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java index d6402f88..9b0ec755 100644 --- a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java @@ -16,8 +16,7 @@ package com.google.cloud.functions.v1.samples; -// [START -// functions_v1_generated_cloudfunctionsserviceclient_callfunction_cloudfunctionnamestring_sync] +// [START functions_v1_generated_cloudfunctionsserviceclient_callfunction_cloudfunctionnamestring_sync] import com.google.cloud.functions.v1.CallFunctionResponse; import com.google.cloud.functions.v1.CloudFunctionName; import com.google.cloud.functions.v1.CloudFunctionsServiceClient; @@ -39,5 +38,4 @@ public static void syncCallFunctionCloudfunctionnameString() throws Exception { } } } -// [END -// functions_v1_generated_cloudfunctionsserviceclient_callfunction_cloudfunctionnamestring_sync] +// [END functions_v1_generated_cloudfunctionsserviceclient_callfunction_cloudfunctionnamestring_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java index 42f34f94..e6bf3251 100644 --- a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java @@ -16,8 +16,7 @@ package com.google.cloud.functions.v1.samples; -// [START -// functions_v1_generated_cloudfunctionsserviceclient_createfunction_locationnamecloudfunction_sync] +// [START functions_v1_generated_cloudfunctionsserviceclient_createfunction_locationnamecloudfunction_sync] import com.google.cloud.functions.v1.CloudFunction; import com.google.cloud.functions.v1.CloudFunctionsServiceClient; import com.google.cloud.functions.v1.LocationName; @@ -40,5 +39,4 @@ public static void syncCreateFunctionLocationnameCloudfunction() throws Exceptio } } } -// [END -// functions_v1_generated_cloudfunctionsserviceclient_createfunction_locationnamecloudfunction_sync] +// [END functions_v1_generated_cloudfunctionsserviceclient_createfunction_locationnamecloudfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java index 89770276..378bbb1f 100644 --- a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java @@ -16,8 +16,7 @@ package com.google.cloud.functions.v1.samples; -// [START -// functions_v1_generated_cloudfunctionsserviceclient_createfunction_stringcloudfunction_sync] +// [START functions_v1_generated_cloudfunctionsserviceclient_createfunction_stringcloudfunction_sync] import com.google.cloud.functions.v1.CloudFunction; import com.google.cloud.functions.v1.CloudFunctionsServiceClient; import com.google.cloud.functions.v1.LocationName; diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java index 89b80149..28a1076b 100644 --- a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java @@ -20,6 +20,7 @@ import com.google.cloud.functions.v1.CloudFunctionName; import com.google.cloud.functions.v1.CloudFunctionsServiceClient; import com.google.cloud.functions.v1.DeleteFunctionRequest; +import com.google.protobuf.Empty; public class SyncDeleteFunction { diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java index df111f77..4cbd62fd 100644 --- a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java @@ -19,6 +19,7 @@ // [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_cloudfunctionname_sync] import com.google.cloud.functions.v1.CloudFunctionName; import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.protobuf.Empty; public class SyncDeleteFunctionCloudfunctionname { diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java index 97b54cda..96c8d12c 100644 --- a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java @@ -19,6 +19,7 @@ // [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_string_sync] import com.google.cloud.functions.v1.CloudFunctionName; import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.protobuf.Empty; public class SyncDeleteFunctionString { diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000..d369d758 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.FunctionServiceSettings; +import com.google.cloud.functions.v2.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + FunctionServiceSettings functionServiceSettings = + FunctionServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + FunctionServiceClient functionServiceClient = + FunctionServiceClient.create(functionServiceSettings); + } +} +// [END functions_v2_generated_functionserviceclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000..d3a21931 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.FunctionServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + FunctionServiceSettings functionServiceSettings = + FunctionServiceSettings.newBuilder() + .setTransportChannelProvider( + FunctionServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + FunctionServiceClient functionServiceClient = + FunctionServiceClient.create(functionServiceSettings); + } +} +// [END functions_v2_generated_functionserviceclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000..9b4c7413 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_create_setendpoint_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.FunctionServiceSettings; +import com.google.cloud.functions.v2.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + FunctionServiceSettings functionServiceSettings = + FunctionServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + FunctionServiceClient functionServiceClient = + FunctionServiceClient.create(functionServiceSettings); + } +} +// [END functions_v2_generated_functionserviceclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunction.java new file mode 100644 index 00000000..dfa81da4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunction.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_createfunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateFunction { + + public static void main(String[] args) throws Exception { + asyncCreateFunction(); + } + + public static void asyncCreateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFunction(Function.newBuilder().build()) + .setFunctionId("functionId-62789869") + .build(); + ApiFuture future = + functionServiceClient.createFunctionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_createfunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunctionLRO.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunctionLRO.java new file mode 100644 index 00000000..946631eb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/AsyncCreateFunctionLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_createfunction_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.functions.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; +import com.google.cloud.functions.v2.OperationMetadata; + +public class AsyncCreateFunctionLRO { + + public static void main(String[] args) throws Exception { + asyncCreateFunctionLRO(); + } + + public static void asyncCreateFunctionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFunction(Function.newBuilder().build()) + .setFunctionId("functionId-62789869") + .build(); + OperationFuture future = + functionServiceClient.createFunctionOperationCallable().futureCall(request); + // Do something. + Function response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_createfunction_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunction.java new file mode 100644 index 00000000..71951fad --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunction.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_createfunction_sync] +import com.google.cloud.functions.v2.CreateFunctionRequest; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; + +public class SyncCreateFunction { + + public static void main(String[] args) throws Exception { + syncCreateFunction(); + } + + public static void syncCreateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFunction(Function.newBuilder().build()) + .setFunctionId("functionId-62789869") + .build(); + Function response = functionServiceClient.createFunctionAsync(request).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_createfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionLocationnameFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionLocationnameFunctionString.java new file mode 100644 index 00000000..5920d62e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionLocationnameFunctionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_createfunction_locationnamefunctionstring_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; + +public class SyncCreateFunctionLocationnameFunctionString { + + public static void main(String[] args) throws Exception { + syncCreateFunctionLocationnameFunctionString(); + } + + public static void syncCreateFunctionLocationnameFunctionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + Function response = + functionServiceClient.createFunctionAsync(parent, function, functionId).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_createfunction_locationnamefunctionstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionStringFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionStringFunctionString.java new file mode 100644 index 00000000..a24b81c5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/createfunction/SyncCreateFunctionStringFunctionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_createfunction_stringfunctionstring_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; + +public class SyncCreateFunctionStringFunctionString { + + public static void main(String[] args) throws Exception { + syncCreateFunctionStringFunctionString(); + } + + public static void syncCreateFunctionStringFunctionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + Function response = + functionServiceClient.createFunctionAsync(parent, function, functionId).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_createfunction_stringfunctionstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunction.java new file mode 100644 index 00000000..975df2e4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunction.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_deletefunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteFunction { + + public static void main(String[] args) throws Exception { + asyncDeleteFunction(); + } + + public static void asyncDeleteFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + ApiFuture future = + functionServiceClient.deleteFunctionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_deletefunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunctionLRO.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunctionLRO.java new file mode 100644 index 00000000..75795c32 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/AsyncDeleteFunctionLRO.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_deletefunction_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteFunctionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteFunctionLRO(); + } + + public static void asyncDeleteFunctionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + OperationFuture future = + functionServiceClient.deleteFunctionOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_deletefunction_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunction.java new file mode 100644 index 00000000..3ec0efb0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunction.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_deletefunction_sync] +import com.google.cloud.functions.v2.DeleteFunctionRequest; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteFunction { + + public static void main(String[] args) throws Exception { + syncDeleteFunction(); + } + + public static void syncDeleteFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + functionServiceClient.deleteFunctionAsync(request).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_deletefunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionFunctionname.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionFunctionname.java new file mode 100644 index 00000000..0f5abcbb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionFunctionname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_deletefunction_functionname_sync] +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteFunctionFunctionname { + + public static void main(String[] args) throws Exception { + syncDeleteFunctionFunctionname(); + } + + public static void syncDeleteFunctionFunctionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + functionServiceClient.deleteFunctionAsync(name).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_deletefunction_functionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionString.java new file mode 100644 index 00000000..fa9dc4bf --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/deletefunction/SyncDeleteFunctionString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_deletefunction_string_sync] +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteFunctionString { + + public static void main(String[] args) throws Exception { + syncDeleteFunctionString(); + } + + public static void syncDeleteFunctionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString(); + functionServiceClient.deleteFunctionAsync(name).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_deletefunction_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java new file mode 100644 index 00000000..c6a19a34 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_generatedownloadurl_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2.GenerateDownloadUrlResponse; + +public class AsyncGenerateDownloadUrl { + + public static void main(String[] args) throws Exception { + asyncGenerateDownloadUrl(); + } + + public static void asyncGenerateDownloadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + ApiFuture future = + functionServiceClient.generateDownloadUrlCallable().futureCall(request); + // Do something. + GenerateDownloadUrlResponse response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_generatedownloadurl_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java new file mode 100644 index 00000000..af3159ee --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_generatedownloadurl_sync] +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2.GenerateDownloadUrlResponse; + +public class SyncGenerateDownloadUrl { + + public static void main(String[] args) throws Exception { + syncGenerateDownloadUrl(); + } + + public static void syncGenerateDownloadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + GenerateDownloadUrlResponse response = functionServiceClient.generateDownloadUrl(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_generatedownloadurl_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java new file mode 100644 index 00000000..13ff09cd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_generateuploadurl_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2.LocationName; + +public class AsyncGenerateUploadUrl { + + public static void main(String[] args) throws Exception { + asyncGenerateUploadUrl(); + } + + public static void asyncGenerateUploadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + ApiFuture future = + functionServiceClient.generateUploadUrlCallable().futureCall(request); + // Do something. + GenerateUploadUrlResponse response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_generateuploadurl_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/SyncGenerateUploadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/SyncGenerateUploadUrl.java new file mode 100644 index 00000000..2a668364 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/generateuploadurl/SyncGenerateUploadUrl.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_generateuploadurl_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2.LocationName; + +public class SyncGenerateUploadUrl { + + public static void main(String[] args) throws Exception { + syncGenerateUploadUrl(); + } + + public static void syncGenerateUploadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_generateuploadurl_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/AsyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/AsyncGetFunction.java new file mode 100644 index 00000000..2bf58306 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/AsyncGetFunction.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_getfunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.GetFunctionRequest; + +public class AsyncGetFunction { + + public static void main(String[] args) throws Exception { + asyncGetFunction(); + } + + public static void asyncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + ApiFuture future = functionServiceClient.getFunctionCallable().futureCall(request); + // Do something. + Function response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_getfunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunction.java new file mode 100644 index 00000000..1ca01831 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunction.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_getfunction_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.GetFunctionRequest; + +public class SyncGetFunction { + + public static void main(String[] args) throws Exception { + syncGetFunction(); + } + + public static void syncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + Function response = functionServiceClient.getFunction(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_getfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionFunctionname.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionFunctionname.java new file mode 100644 index 00000000..28dd7989 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionFunctionname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_getfunction_functionname_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; + +public class SyncGetFunctionFunctionname { + + public static void main(String[] args) throws Exception { + syncGetFunctionFunctionname(); + } + + public static void syncGetFunctionFunctionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + Function response = functionServiceClient.getFunction(name); + } + } +} +// [END functions_v2_generated_functionserviceclient_getfunction_functionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionString.java new file mode 100644 index 00000000..d5b89540 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getfunction/SyncGetFunctionString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_getfunction_string_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; + +public class SyncGetFunctionString { + + public static void main(String[] args) throws Exception { + syncGetFunctionString(); + } + + public static void syncGetFunctionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString(); + Function response = functionServiceClient.getFunction(name); + } + } +} +// [END functions_v2_generated_functionserviceclient_getfunction_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/AsyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 00000000..c6e76912 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = functionServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_getiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/SyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 00000000..9d768ecd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_getiampolicy_sync] +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = functionServiceClient.getIamPolicy(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_getiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctions.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctions.java new file mode 100644 index 00000000..d10b57e7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctions.java @@ -0,0 +1,53 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listfunctions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.LocationName; + +public class AsyncListFunctions { + + public static void main(String[] args) throws Exception { + asyncListFunctions(); + } + + public static void asyncListFunctions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + functionServiceClient.listFunctionsPagedCallable().futureCall(request); + // Do something. + for (Function element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listfunctions_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctionsPaged.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctionsPaged.java new file mode 100644 index 00000000..586d7782 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/AsyncListFunctionsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listfunctions_paged_async] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.ListFunctionsResponse; +import com.google.cloud.functions.v2.LocationName; +import com.google.common.base.Strings; + +public class AsyncListFunctionsPaged { + + public static void main(String[] args) throws Exception { + asyncListFunctionsPaged(); + } + + public static void asyncListFunctionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListFunctionsResponse response = + functionServiceClient.listFunctionsCallable().call(request); + for (Function element : response.getFunctionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listfunctions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctions.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctions.java new file mode 100644 index 00000000..aeb6bae5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctions.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listfunctions_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListFunctionsRequest; +import com.google.cloud.functions.v2.LocationName; + +public class SyncListFunctions { + + public static void main(String[] args) throws Exception { + syncListFunctions(); + } + + public static void syncListFunctions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Function element : functionServiceClient.listFunctions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listfunctions_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsLocationname.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsLocationname.java new file mode 100644 index 00000000..2fc7bf5b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listfunctions_locationname_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; + +public class SyncListFunctionsLocationname { + + public static void main(String[] args) throws Exception { + syncListFunctionsLocationname(); + } + + public static void syncListFunctionsLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listfunctions_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsString.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsString.java new file mode 100644 index 00000000..da749b6c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listfunctions/SyncListFunctionsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listfunctions_string_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.LocationName; + +public class SyncListFunctionsString { + + public static void main(String[] args) throws Exception { + syncListFunctionsString(); + } + + public static void syncListFunctionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listfunctions_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocations.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 00000000..10907211 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocations.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + functionServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listlocations_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocationsPaged.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 00000000..efaa47c4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listlocations_paged_async] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + functionServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listlocations_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/SyncListLocations.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 00000000..6a3417e2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listlocations/SyncListLocations.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listlocations_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : functionServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v2_generated_functionserviceclient_listlocations_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/AsyncListRuntimes.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/AsyncListRuntimes.java new file mode 100644 index 00000000..359a58a2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/AsyncListRuntimes.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listruntimes_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListRuntimesRequest; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.LocationName; + +public class AsyncListRuntimes { + + public static void main(String[] args) throws Exception { + asyncListRuntimes(); + } + + public static void asyncListRuntimes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListRuntimesRequest request = + ListRuntimesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + functionServiceClient.listRuntimesCallable().futureCall(request); + // Do something. + ListRuntimesResponse response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_listruntimes_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimes.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimes.java new file mode 100644 index 00000000..e5421610 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimes.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listruntimes_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListRuntimesRequest; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.LocationName; + +public class SyncListRuntimes { + + public static void main(String[] args) throws Exception { + syncListRuntimes(); + } + + public static void syncListRuntimes() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + ListRuntimesRequest request = + ListRuntimesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFilter("filter-1274492040") + .build(); + ListRuntimesResponse response = functionServiceClient.listRuntimes(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_listruntimes_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesLocationname.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesLocationname.java new file mode 100644 index 00000000..6811da07 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesLocationname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listruntimes_locationname_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.LocationName; + +public class SyncListRuntimesLocationname { + + public static void main(String[] args) throws Exception { + syncListRuntimesLocationname(); + } + + public static void syncListRuntimesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ListRuntimesResponse response = functionServiceClient.listRuntimes(parent); + } + } +} +// [END functions_v2_generated_functionserviceclient_listruntimes_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesString.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesString.java new file mode 100644 index 00000000..5414645f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/listruntimes/SyncListRuntimesString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_listruntimes_string_sync] +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.ListRuntimesResponse; +import com.google.cloud.functions.v2.LocationName; + +public class SyncListRuntimesString { + + public static void main(String[] args) throws Exception { + syncListRuntimesString(); + } + + public static void syncListRuntimesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + ListRuntimesResponse response = functionServiceClient.listRuntimes(parent); + } + } +} +// [END functions_v2_generated_functionserviceclient_listruntimes_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/AsyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 00000000..6afb7817 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = functionServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_setiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/SyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 00000000..b86eb9ba --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_setiampolicy_sync] +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = functionServiceClient.setIamPolicy(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_setiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/AsyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 00000000..0d99a64c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + functionServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_testiampermissions_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/SyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 00000000..dd3e04b4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_testiampermissions_sync] +import com.google.cloud.functions.v2.FunctionName; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = functionServiceClient.testIamPermissions(request); + } + } +} +// [END functions_v2_generated_functionserviceclient_testiampermissions_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunction.java new file mode 100644 index 00000000..f346b080 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunction.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_updatefunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateFunction { + + public static void main(String[] args) throws Exception { + asyncUpdateFunction(); + } + + public static void asyncUpdateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(Function.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + functionServiceClient.updateFunctionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_updatefunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunctionLRO.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunctionLRO.java new file mode 100644 index 00000000..35b8ff41 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/AsyncUpdateFunctionLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_updatefunction_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.OperationMetadata; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateFunctionLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateFunctionLRO(); + } + + public static void asyncUpdateFunctionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(Function.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + OperationFuture future = + functionServiceClient.updateFunctionOperationCallable().futureCall(request); + // Do something. + Function response = future.get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_updatefunction_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunction.java new file mode 100644 index 00000000..4081efd1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_updatefunction_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.cloud.functions.v2.UpdateFunctionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateFunction { + + public static void main(String[] args) throws Exception { + syncUpdateFunction(); + } + + public static void syncUpdateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(Function.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Function response = functionServiceClient.updateFunctionAsync(request).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_updatefunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunctionFunctionFieldmask.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunctionFunctionFieldmask.java new file mode 100644 index 00000000..4b2474b0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionserviceclient/updatefunction/SyncUpdateFunctionFunctionFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionserviceclient_updatefunction_functionfieldmask_sync] +import com.google.cloud.functions.v2.Function; +import com.google.cloud.functions.v2.FunctionServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateFunctionFunctionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateFunctionFunctionFieldmask(); + } + + public static void syncUpdateFunctionFunctionFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) { + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Function response = functionServiceClient.updateFunctionAsync(function, updateMask).get(); + } + } +} +// [END functions_v2_generated_functionserviceclient_updatefunction_functionfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/functionservicesettings/getfunction/SyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/functionservicesettings/getfunction/SyncGetFunction.java new file mode 100644 index 00000000..63f588b5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/functionservicesettings/getfunction/SyncGetFunction.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.v2.samples; + +// [START functions_v2_generated_functionservicesettings_getfunction_sync] +import com.google.cloud.functions.v2.FunctionServiceSettings; +import java.time.Duration; + +public class SyncGetFunction { + + public static void main(String[] args) throws Exception { + syncGetFunction(); + } + + public static void syncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + FunctionServiceSettings.Builder functionServiceSettingsBuilder = + FunctionServiceSettings.newBuilder(); + functionServiceSettingsBuilder + .getFunctionSettings() + .setRetrySettings( + functionServiceSettingsBuilder + .getFunctionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + FunctionServiceSettings functionServiceSettings = functionServiceSettingsBuilder.build(); + } +} +// [END functions_v2_generated_functionservicesettings_getfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v2/stub/functionservicestubsettings/getfunction/SyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v2/stub/functionservicestubsettings/getfunction/SyncGetFunction.java new file mode 100644 index 00000000..d4098147 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v2/stub/functionservicestubsettings/getfunction/SyncGetFunction.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 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.v2.stub.samples; + +// [START functions_v2_generated_functionservicestubsettings_getfunction_sync] +import com.google.cloud.functions.v2.stub.FunctionServiceStubSettings; +import java.time.Duration; + +public class SyncGetFunction { + + public static void main(String[] args) throws Exception { + syncGetFunction(); + } + + public static void syncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + FunctionServiceStubSettings.Builder functionServiceSettingsBuilder = + FunctionServiceStubSettings.newBuilder(); + functionServiceSettingsBuilder + .getFunctionSettings() + .setRetrySettings( + functionServiceSettingsBuilder + .getFunctionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + FunctionServiceStubSettings functionServiceSettings = functionServiceSettingsBuilder.build(); + } +} +// [END functions_v2_generated_functionservicestubsettings_getfunction_sync] diff --git a/versions.txt b/versions.txt index b0211d99..a0c3f51f 100644 --- a/versions.txt +++ b/versions.txt @@ -8,3 +8,5 @@ proto-google-cloud-functions-v2beta:2.4.3:2.4.3 proto-google-cloud-functions-v2alpha:2.4.3:2.4.3 grpc-google-cloud-functions-v2beta:2.4.3:2.4.3 grpc-google-cloud-functions-v2alpha:2.4.3:2.4.3 +proto-google-cloud-functions-v2:2.4.3:2.4.3 +grpc-google-cloud-functions-v2:2.4.3:2.4.3 From c3b70c0d021dea4f98d6723814684b449786acb3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 26 Jul 2022 19:26:14 +0000 Subject: [PATCH 05/10] ci: adjust owlbot-java for monorepo (#1500) (#450) Source-Link: https://github.com/googleapis/synthtool/commit/48f8857c642792150e2474418b1dbf545c162f8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:b47e411068ffc6e6990cb4e0802fbac9a4488dec7f5f424553518ba21abea208 --- .github/.OwlBot.lock.yaml | 4 ++-- README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6610882f..f8b912ad 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:04f254abfe5f47fe73ae6f91d68d55c3b76e722a4943066c3bb0ce03573b4ad9 -# created: 2022-07-18T21:44:23.94208526Z + digest: sha256:b47e411068ffc6e6990cb4e0802fbac9a4488dec7f5f424553518ba21abea208 +# created: 2022-07-26T16:25:31.033836225Z diff --git a/README.md b/README.md index 198a6a8f..c83c52c3 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-functions - 2.4.2 + 2.4.3 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-functions:2.4.2' +implementation 'com.google.cloud:google-cloud-functions:2.4.3' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "2.4.2" +libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "2.4.3" ``` ## Authentication From e1351f7060b6634b42baf8822455a464f7944a26 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 20:48:30 +0200 Subject: [PATCH 06/10] build(deps): update dependency com.google.cloud:google-cloud-shared-config to v1.5.3 (#452) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-config](https://togithub.com/googleapis/java-shared-config) | `1.5.1` -> `1.5.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/compatibility-slim/1.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-config/1.5.3/confidence-slim/1.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-config ### [`v1.5.3`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​153-httpsgithubcomgoogleapisjava-shared-configcomparev152v153-2022-07-27) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.2...v1.5.3) ##### Dependencies - update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#​497](https://togithub.com/googleapis/java-shared-config/issues/497)) ([1fc6ab4](https://togithub.com/googleapis/java-shared-config/commit/1fc6ab445624cd4f9c8b161d109f346a9e5ed09a)) - Update doclet to latest version 1.6.0 ([38fb7c3](https://togithub.com/googleapis/java-shared-config/commit/38fb7c3957fb6c9b2da10f9e463cc93a8b80a3a4)) ### [`v1.5.2`](https://togithub.com/googleapis/java-shared-config/blob/HEAD/CHANGELOG.md#​152-httpsgithubcomgoogleapisjava-shared-configcomparev151v152-2022-07-25) [Compare Source](https://togithub.com/googleapis/java-shared-config/compare/v1.5.1...v1.5.2) ##### Dependencies - update dependency com.puppycrawl.tools:checkstyle to v10 ([#​435](https://togithub.com/googleapis/java-shared-config/issues/435)) ([bfc8ce1](https://togithub.com/googleapis/java-shared-config/commit/bfc8ce1deca6292147d002d3afe22a09840aa5d6)) - update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#​488](https://togithub.com/googleapis/java-shared-config/issues/488)) ([39b91ee](https://togithub.com/googleapis/java-shared-config/commit/39b91ee1283f0a5fbbe63e8bfd1ec97ab4ab377e)) - update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#​489](https://togithub.com/googleapis/java-shared-config/issues/489)) ([cc3bcfa](https://togithub.com/googleapis/java-shared-config/commit/cc3bcfa2d6717441a8d5b5048fa78c2cf7aabf2b))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-functions). --- google-cloud-functions-bom/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index 2820f75a..b0d2ab51 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud google-cloud-shared-config - 1.5.1 + 1.5.3 Google Cloud Functions BOM diff --git a/pom.xml b/pom.xml index abd8aca4..66a5b504 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud google-cloud-shared-config - 1.5.1 + 1.5.3 From 18dbe63681d756a4d8e8081921a11c798f9a1ca4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 21:12:29 +0200 Subject: [PATCH 07/10] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3 (#451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-shared-dependencies](https://togithub.com/googleapis/java-shared-dependencies) | `2.13.0` -> `3.0.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/compatibility-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-shared-dependencies/3.0.1/confidence-slim/2.13.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-shared-dependencies ### [`v3.0.1`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​301-httpsgithubcomgoogleapisjava-shared-dependenciescomparev300v301-2022-08-02) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v3.0.0...v3.0.1) ##### Dependencies - update dependency com.google.code.gson:gson to v2.9.1 ([#​766](https://togithub.com/googleapis/java-shared-dependencies/issues/766)) ([f7b2b06](https://togithub.com/googleapis/java-shared-dependencies/commit/f7b2b06b80e3e95ff8ab9b1d6a2638ef3069298a)) - update gax.version to v2.18.7 ([#​767](https://togithub.com/googleapis/java-shared-dependencies/issues/767)) ([9650368](https://togithub.com/googleapis/java-shared-dependencies/commit/96503682e98cdf348ea2c1365a03a60f4322c712)) - update google.core.version to v2.8.6 ([#​770](https://togithub.com/googleapis/java-shared-dependencies/issues/770)) ([cfd4377](https://togithub.com/googleapis/java-shared-dependencies/commit/cfd4377dc178cebb4724065d55d185ce03988d55)) ### [`v3.0.0`](https://togithub.com/googleapis/java-shared-dependencies/blob/HEAD/CHANGELOG.md#​300-httpsgithubcomgoogleapisjava-shared-dependenciescomparev2130v300-2022-07-29) [Compare Source](https://togithub.com/googleapis/java-shared-dependencies/compare/v2.13.0...v3.0.0) ##### Bug Fixes - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/java-shared-dependencies/issues/1485)) ([#​738](https://togithub.com/googleapis/java-shared-dependencies/issues/738)) ([11bc8f8](https://togithub.com/googleapis/java-shared-dependencies/commit/11bc8f81f28be88a97fdeafca21724e33638770c)) ##### Dependencies - update dependency com.google.api-client:google-api-client-bom to v1.35.2 ([#​729](https://togithub.com/googleapis/java-shared-dependencies/issues/729)) ([1fa59af](https://togithub.com/googleapis/java-shared-dependencies/commit/1fa59af80abb9f278f57658c10158567e825fec6)) - update dependency com.google.api-client:google-api-client-bom to v2 ([#​746](https://togithub.com/googleapis/java-shared-dependencies/issues/746)) ([2dcb2e0](https://togithub.com/googleapis/java-shared-dependencies/commit/2dcb2e071e0ba0eea21bb575bd13cd559d4a1ca6)) - update dependency com.google.api.grpc:grpc-google-common-protos to v2.9.2 ([#​741](https://togithub.com/googleapis/java-shared-dependencies/issues/741)) ([3352d6c](https://togithub.com/googleapis/java-shared-dependencies/commit/3352d6c36111c04e3f6f3e6360470fa3efb10d8f)) - update dependency com.google.auth:google-auth-library-bom to v1.8.0 ([#​726](https://togithub.com/googleapis/java-shared-dependencies/issues/726)) ([2c5d64c](https://togithub.com/googleapis/java-shared-dependencies/commit/2c5d64c127db8384e49113acfeac6928716a2d7f)) - update dependency com.google.auth:google-auth-library-bom to v1.8.1 ([#​742](https://togithub.com/googleapis/java-shared-dependencies/issues/742)) ([4f53527](https://togithub.com/googleapis/java-shared-dependencies/commit/4f53527bda7f40896711b7c1d1c02453321ffbc8)) - update dependency com.google.cloud:first-party-dependencies to v2 ([#​747](https://togithub.com/googleapis/java-shared-dependencies/issues/747)) ([e970ac0](https://togithub.com/googleapis/java-shared-dependencies/commit/e970ac0599941c825dc2516146a7c6673e68a9b9)) - update dependency com.google.cloud:grpc-gcp to v1.2.1 ([#​751](https://togithub.com/googleapis/java-shared-dependencies/issues/751)) ([b3284b6](https://togithub.com/googleapis/java-shared-dependencies/commit/b3284b6ee52a96a6ea8696a05a94443df9ee5b9f)) - update dependency com.google.cloud:third-party-dependencies to v2 ([#​748](https://togithub.com/googleapis/java-shared-dependencies/issues/748)) ([573b41a](https://togithub.com/googleapis/java-shared-dependencies/commit/573b41a69504372741cbeb01dd200e7c71967186)) - update dependency com.google.http-client:google-http-client-bom to v1.42.1 ([#​730](https://togithub.com/googleapis/java-shared-dependencies/issues/730)) ([6b47126](https://togithub.com/googleapis/java-shared-dependencies/commit/6b47126686b603a5d112e097ce6aa3a1880daf6f)) - update dependency com.google.http-client:google-http-client-bom to v1.42.2 ([#​749](https://togithub.com/googleapis/java-shared-dependencies/issues/749)) ([299d7b0](https://togithub.com/googleapis/java-shared-dependencies/commit/299d7b0d4920644e2c3070d12dd1d97da17a5e88)) - update dependency com.google.protobuf:protobuf-bom to v3.21.2 ([#​722](https://togithub.com/googleapis/java-shared-dependencies/issues/722)) ([7a96b12](https://togithub.com/googleapis/java-shared-dependencies/commit/7a96b1259a526b63e9376fd6cc18b27cddeb5f0f)) - update dependency com.google.protobuf:protobuf-bom to v3.21.3 ([#​756](https://togithub.com/googleapis/java-shared-dependencies/issues/756)) ([3d0bac2](https://togithub.com/googleapis/java-shared-dependencies/commit/3d0bac23487aebb94267c0708f41ff6c02a028a4)) - update dependency com.google.protobuf:protobuf-bom to v3.21.4 ([#​759](https://togithub.com/googleapis/java-shared-dependencies/issues/759)) ([5a54ef1](https://togithub.com/googleapis/java-shared-dependencies/commit/5a54ef1a2d56244166d4fcc46041d62c0dc4b411)) - update dependency io.grpc:grpc-bom to v1.48.0 ([#​752](https://togithub.com/googleapis/java-shared-dependencies/issues/752)) ([20ac908](https://togithub.com/googleapis/java-shared-dependencies/commit/20ac908932a5e7c8e581bdfcd68579d7e1cedd5f)) - update dependency org.checkerframework:checker-qual to v3.23.0 ([#​736](https://togithub.com/googleapis/java-shared-dependencies/issues/736)) ([fc01d8f](https://togithub.com/googleapis/java-shared-dependencies/commit/fc01d8f93f391f12fdb800d5006f0b4505832eeb)) - update gax.version to v2.18.3 ([#​731](https://togithub.com/googleapis/java-shared-dependencies/issues/731)) ([e8ee554](https://togithub.com/googleapis/java-shared-dependencies/commit/e8ee554707acb2f71c739d08e2ff02fbe43ffa52)) - update gax.version to v2.18.4 ([#​735](https://togithub.com/googleapis/java-shared-dependencies/issues/735)) ([11c7415](https://togithub.com/googleapis/java-shared-dependencies/commit/11c74152a84697924de3a0e838b05f606c3098f7)) - update gax.version to v2.18.5 ([#​758](https://togithub.com/googleapis/java-shared-dependencies/issues/758)) ([7469fc1](https://togithub.com/googleapis/java-shared-dependencies/commit/7469fc1cc5095b39a5738e60156711a268f6e052)) - update gax.version to v2.18.6 ([#​763](https://togithub.com/googleapis/java-shared-dependencies/issues/763)) ([b5ca2f7](https://togithub.com/googleapis/java-shared-dependencies/commit/b5ca2f7b4d81c705823253f4f03363a32d2be48b)) - update google.common-protos.version to v2.9.1 ([#​724](https://togithub.com/googleapis/java-shared-dependencies/issues/724)) ([5213dbb](https://togithub.com/googleapis/java-shared-dependencies/commit/5213dbbfa9c9b73d2420ec2be7782f16c9c4955f)) - update google.core.version to v2.8.1 ([#​725](https://togithub.com/googleapis/java-shared-dependencies/issues/725)) ([575858a](https://togithub.com/googleapis/java-shared-dependencies/commit/575858a60f76e46bbc2a2435c2b6c01c8f4ab681)) - update google.core.version to v2.8.3 ([#​760](https://togithub.com/googleapis/java-shared-dependencies/issues/760)) ([cb10ae4](https://togithub.com/googleapis/java-shared-dependencies/commit/cb10ae4b76939215ea465af74163b3d4ad65a548)) - update google.core.version to v2.8.4 ([#​762](https://togithub.com/googleapis/java-shared-dependencies/issues/762)) ([821daaf](https://togithub.com/googleapis/java-shared-dependencies/commit/821daafefdbcfdfe6e363e580747538096a562ef)) - update google.core.version to v2.8.5 ([#​764](https://togithub.com/googleapis/java-shared-dependencies/issues/764)) ([a1f8f50](https://togithub.com/googleapis/java-shared-dependencies/commit/a1f8f501b54143a2cec8e72efd4ceb3ce47f13ae)) - update iam.version to v1.5.0 ([#​732](https://togithub.com/googleapis/java-shared-dependencies/issues/732)) ([9dce0e5](https://togithub.com/googleapis/java-shared-dependencies/commit/9dce0e5199c1e425119adc804304958f58003a27)) - update iam.version to v1.5.1 ([#​737](https://togithub.com/googleapis/java-shared-dependencies/issues/737)) ([df39168](https://togithub.com/googleapis/java-shared-dependencies/commit/df391685d42fcb1b04f03ab1380a594893bdce37)) - update iam.version to v1.5.2 ([#​743](https://togithub.com/googleapis/java-shared-dependencies/issues/743)) ([cdde697](https://togithub.com/googleapis/java-shared-dependencies/commit/cdde697f25a89fc8c2ec7eae6b7c54f69977bb1c))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-functions). --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 66a5b504..72d94181 100644 --- a/pom.xml +++ b/pom.xml @@ -107,7 +107,7 @@ com.google.cloud google-cloud-shared-dependencies - 2.13.0 + 3.0.1 pom import From d6b80d5e538bca2bde20b2d3a9c2ee56822d8b3b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 21:14:35 +0200 Subject: [PATCH 08/10] chore(deps): update dependency com.google.cloud:google-cloud-functions to v2.4.3 (#453) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-functions](https://togithub.com/googleapis/java-functions) | `2.4.1` -> `2.4.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-functions/2.4.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-functions/2.4.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-functions/2.4.3/compatibility-slim/2.4.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-functions/2.4.3/confidence-slim/2.4.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-functions ### [`v2.4.3`](https://togithub.com/googleapis/java-functions/blob/HEAD/CHANGELOG.md#​243-httpsgithubcomgoogleapisjava-functionscomparev242v243-2022-07-13) [Compare Source](https://togithub.com/googleapis/java-functions/compare/v2.4.2...v2.4.3) ##### Bug Fixes - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/java-functions/issues/1485)) ([#​443](https://togithub.com/googleapis/java-functions/issues/443)) ([d466ebc](https://togithub.com/googleapis/java-functions/commit/d466ebcbef50f65391fb8e8ebed265a783a5acf9)) ### [`v2.4.2`](https://togithub.com/googleapis/java-functions/blob/HEAD/CHANGELOG.md#​242-httpsgithubcomgoogleapisjava-functionscomparev241v242-2022-07-01) [Compare Source](https://togithub.com/googleapis/java-functions/compare/v2.4.1...v2.4.2) ##### Bug Fixes - update gapic-generator-java with mock service generation fixes ([#​424](https://togithub.com/googleapis/java-functions/issues/424)) ([721c8dc](https://togithub.com/googleapis/java-functions/commit/721c8dcc1f75feee52a82be47b292bb7d9dad887))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-functions). --- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- samples/snippets/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 50f3a0fa..7368de4e 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-functions - 2.4.1 + 2.4.3 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6eb1dc06..96791a5b 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-functions - 2.4.1 + 2.4.3 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index e2d6a655..18be5e3f 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-functions - 2.4.1 + 2.4.3 From 1ce65eb8b51f49823fb15fa1f8a7a87cdeb3332c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 23:44:13 +0000 Subject: [PATCH 09/10] chore(main): release 2.4.4-SNAPSHOT (#454) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- google-cloud-functions-bom/pom.xml | 20 ++++++++++---------- google-cloud-functions/pom.xml | 4 ++-- grpc-google-cloud-functions-v1/pom.xml | 4 ++-- grpc-google-cloud-functions-v2/pom.xml | 4 ++-- grpc-google-cloud-functions-v2alpha/pom.xml | 4 ++-- grpc-google-cloud-functions-v2beta/pom.xml | 4 ++-- pom.xml | 20 ++++++++++---------- proto-google-cloud-functions-v1/pom.xml | 4 ++-- proto-google-cloud-functions-v2/pom.xml | 4 ++-- proto-google-cloud-functions-v2alpha/pom.xml | 4 ++-- proto-google-cloud-functions-v2beta/pom.xml | 4 ++-- versions.txt | 18 +++++++++--------- 12 files changed, 47 insertions(+), 47 deletions(-) diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index b0d2ab51..45335f1b 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-functions-bom - 2.4.3 + 2.4.4-SNAPSHOT pom com.google.cloud @@ -56,47 +56,47 @@ com.google.cloud google-cloud-functions - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v1 - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v2beta - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v2alpha - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v2 - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v1 - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v2beta - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v2alpha - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v2 - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/google-cloud-functions/pom.xml b/google-cloud-functions/pom.xml index a7ced942..770dd72c 100644 --- a/google-cloud-functions/pom.xml +++ b/google-cloud-functions/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-functions - 2.4.3 + 2.4.4-SNAPSHOT jar Google Cloud Functions https://github.com/googleapis/java-functions @@ -11,7 +11,7 @@ com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT google-cloud-functions diff --git a/grpc-google-cloud-functions-v1/pom.xml b/grpc-google-cloud-functions-v1/pom.xml index ebe0726e..5505fd6d 100644 --- a/grpc-google-cloud-functions-v1/pom.xml +++ b/grpc-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 2.4.3 + 2.4.4-SNAPSHOT grpc-google-cloud-functions-v1 GRPC library for grpc-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/grpc-google-cloud-functions-v2/pom.xml b/grpc-google-cloud-functions-v2/pom.xml index ca917083..826a21b9 100644 --- a/grpc-google-cloud-functions-v2/pom.xml +++ b/grpc-google-cloud-functions-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v2 - 2.4.3 + 2.4.4-SNAPSHOT grpc-google-cloud-functions-v2 GRPC library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/grpc-google-cloud-functions-v2alpha/pom.xml b/grpc-google-cloud-functions-v2alpha/pom.xml index 907077b8..e5047614 100644 --- a/grpc-google-cloud-functions-v2alpha/pom.xml +++ b/grpc-google-cloud-functions-v2alpha/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v2alpha - 2.4.3 + 2.4.4-SNAPSHOT grpc-google-cloud-functions-v2alpha GRPC library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/grpc-google-cloud-functions-v2beta/pom.xml b/grpc-google-cloud-functions-v2beta/pom.xml index 93f7e59e..85c0c677 100644 --- a/grpc-google-cloud-functions-v2beta/pom.xml +++ b/grpc-google-cloud-functions-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v2beta - 2.4.3 + 2.4.4-SNAPSHOT grpc-google-cloud-functions-v2beta GRPC library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/pom.xml b/pom.xml index 72d94181..b5d2cc7a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-functions-parent pom - 2.4.3 + 2.4.4-SNAPSHOT Google Cloud Functions Parent https://github.com/googleapis/java-functions @@ -61,47 +61,47 @@ com.google.cloud google-cloud-functions - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v2 - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v2 - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v2alpha - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v2beta - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v2alpha - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v2beta - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc proto-google-cloud-functions-v1 - 2.4.3 + 2.4.4-SNAPSHOT com.google.api.grpc grpc-google-cloud-functions-v1 - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/proto-google-cloud-functions-v1/pom.xml b/proto-google-cloud-functions-v1/pom.xml index 4049c2bf..8cc124bf 100644 --- a/proto-google-cloud-functions-v1/pom.xml +++ b/proto-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v1 - 2.4.3 + 2.4.4-SNAPSHOT proto-google-cloud-functions-v1 PROTO library for proto-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/proto-google-cloud-functions-v2/pom.xml b/proto-google-cloud-functions-v2/pom.xml index b2f5505e..21d06673 100644 --- a/proto-google-cloud-functions-v2/pom.xml +++ b/proto-google-cloud-functions-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v2 - 2.4.3 + 2.4.4-SNAPSHOT proto-google-cloud-functions-v2 Proto library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/proto-google-cloud-functions-v2alpha/pom.xml b/proto-google-cloud-functions-v2alpha/pom.xml index 73e5cd41..94c2fb68 100644 --- a/proto-google-cloud-functions-v2alpha/pom.xml +++ b/proto-google-cloud-functions-v2alpha/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v2alpha - 2.4.3 + 2.4.4-SNAPSHOT proto-google-cloud-functions-v2alpha Proto library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/proto-google-cloud-functions-v2beta/pom.xml b/proto-google-cloud-functions-v2beta/pom.xml index 4e98d463..346333e6 100644 --- a/proto-google-cloud-functions-v2beta/pom.xml +++ b/proto-google-cloud-functions-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v2beta - 2.4.3 + 2.4.4-SNAPSHOT proto-google-cloud-functions-v2beta Proto library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.3 + 2.4.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index a0c3f51f..69b5dc12 100644 --- a/versions.txt +++ b/versions.txt @@ -1,12 +1,12 @@ # Format: # module:released-version:current-version -google-cloud-functions:2.4.3:2.4.3 -grpc-google-cloud-functions-v1:2.4.3:2.4.3 -proto-google-cloud-functions-v1:2.4.3:2.4.3 -proto-google-cloud-functions-v2beta:2.4.3:2.4.3 -proto-google-cloud-functions-v2alpha:2.4.3:2.4.3 -grpc-google-cloud-functions-v2beta:2.4.3:2.4.3 -grpc-google-cloud-functions-v2alpha:2.4.3:2.4.3 -proto-google-cloud-functions-v2:2.4.3:2.4.3 -grpc-google-cloud-functions-v2:2.4.3:2.4.3 +google-cloud-functions:2.4.3:2.4.4-SNAPSHOT +grpc-google-cloud-functions-v1:2.4.3:2.4.4-SNAPSHOT +proto-google-cloud-functions-v1:2.4.3:2.4.4-SNAPSHOT +proto-google-cloud-functions-v2beta:2.4.3:2.4.4-SNAPSHOT +proto-google-cloud-functions-v2alpha:2.4.3:2.4.4-SNAPSHOT +grpc-google-cloud-functions-v2beta:2.4.3:2.4.4-SNAPSHOT +grpc-google-cloud-functions-v2alpha:2.4.3:2.4.4-SNAPSHOT +proto-google-cloud-functions-v2:2.4.3:2.4.4-SNAPSHOT +grpc-google-cloud-functions-v2:2.4.3:2.4.4-SNAPSHOT From 039175083078198ed433aec6b9c900dab55cb96a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 9 Aug 2022 18:00:19 +0000 Subject: [PATCH 10/10] chore(main): release 2.5.0 (#455) :robot: I have created a release *beep* *boop* --- ## [2.5.0](https://github.com/googleapis/java-functions/compare/v2.4.3...v2.5.0) (2022-08-04) ### Features * generating GAPIC libraries for Google Cloud Functions v2beta ([#441](https://github.com/googleapis/java-functions/issues/441)) ([d56a252](https://github.com/googleapis/java-functions/commit/d56a252c7297e57d41f00b676c4bdf0b5f23eb97)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#451](https://github.com/googleapis/java-functions/issues/451)) ([18dbe63](https://github.com/googleapis/java-functions/commit/18dbe63681d756a4d8e8081921a11c798f9a1ca4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 12 ++++++++++++ google-cloud-functions-bom/pom.xml | 20 ++++++++++---------- google-cloud-functions/pom.xml | 4 ++-- grpc-google-cloud-functions-v1/pom.xml | 4 ++-- grpc-google-cloud-functions-v2/pom.xml | 4 ++-- grpc-google-cloud-functions-v2alpha/pom.xml | 4 ++-- grpc-google-cloud-functions-v2beta/pom.xml | 4 ++-- pom.xml | 20 ++++++++++---------- proto-google-cloud-functions-v1/pom.xml | 4 ++-- proto-google-cloud-functions-v2/pom.xml | 4 ++-- proto-google-cloud-functions-v2alpha/pom.xml | 4 ++-- proto-google-cloud-functions-v2beta/pom.xml | 4 ++-- versions.txt | 18 +++++++++--------- 13 files changed, 59 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b0c732c..4a233a7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.5.0](https://github.com/googleapis/java-functions/compare/v2.4.3...v2.5.0) (2022-08-04) + + +### Features + +* generating GAPIC libraries for Google Cloud Functions v2beta ([#441](https://github.com/googleapis/java-functions/issues/441)) ([d56a252](https://github.com/googleapis/java-functions/commit/d56a252c7297e57d41f00b676c4bdf0b5f23eb97)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#451](https://github.com/googleapis/java-functions/issues/451)) ([18dbe63](https://github.com/googleapis/java-functions/commit/18dbe63681d756a4d8e8081921a11c798f9a1ca4)) + ## [2.4.3](https://github.com/googleapis/java-functions/compare/v2.4.2...v2.4.3) (2022-07-13) diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index 45335f1b..d2ae3353 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-functions-bom - 2.4.4-SNAPSHOT + 2.5.0 pom com.google.cloud @@ -56,47 +56,47 @@ com.google.cloud google-cloud-functions - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v2beta - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v2alpha - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v2 - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v1 - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v2beta - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v2alpha - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v2 - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/google-cloud-functions/pom.xml b/google-cloud-functions/pom.xml index 770dd72c..05e30bd5 100644 --- a/google-cloud-functions/pom.xml +++ b/google-cloud-functions/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-functions - 2.4.4-SNAPSHOT + 2.5.0 jar Google Cloud Functions https://github.com/googleapis/java-functions @@ -11,7 +11,7 @@ com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 google-cloud-functions diff --git a/grpc-google-cloud-functions-v1/pom.xml b/grpc-google-cloud-functions-v1/pom.xml index 5505fd6d..ebb1e83f 100644 --- a/grpc-google-cloud-functions-v1/pom.xml +++ b/grpc-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 2.4.4-SNAPSHOT + 2.5.0 grpc-google-cloud-functions-v1 GRPC library for grpc-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/grpc-google-cloud-functions-v2/pom.xml b/grpc-google-cloud-functions-v2/pom.xml index 826a21b9..467b9c87 100644 --- a/grpc-google-cloud-functions-v2/pom.xml +++ b/grpc-google-cloud-functions-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v2 - 2.4.4-SNAPSHOT + 2.5.0 grpc-google-cloud-functions-v2 GRPC library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/grpc-google-cloud-functions-v2alpha/pom.xml b/grpc-google-cloud-functions-v2alpha/pom.xml index e5047614..c9878479 100644 --- a/grpc-google-cloud-functions-v2alpha/pom.xml +++ b/grpc-google-cloud-functions-v2alpha/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v2alpha - 2.4.4-SNAPSHOT + 2.5.0 grpc-google-cloud-functions-v2alpha GRPC library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/grpc-google-cloud-functions-v2beta/pom.xml b/grpc-google-cloud-functions-v2beta/pom.xml index 85c0c677..a6aa3787 100644 --- a/grpc-google-cloud-functions-v2beta/pom.xml +++ b/grpc-google-cloud-functions-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-functions-v2beta - 2.4.4-SNAPSHOT + 2.5.0 grpc-google-cloud-functions-v2beta GRPC library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/pom.xml b/pom.xml index b5d2cc7a..d737726d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-functions-parent pom - 2.4.4-SNAPSHOT + 2.5.0 Google Cloud Functions Parent https://github.com/googleapis/java-functions @@ -61,47 +61,47 @@ com.google.cloud google-cloud-functions - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v2 - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v2 - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v2alpha - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v2beta - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v2alpha - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v2beta - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc proto-google-cloud-functions-v1 - 2.4.4-SNAPSHOT + 2.5.0 com.google.api.grpc grpc-google-cloud-functions-v1 - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/proto-google-cloud-functions-v1/pom.xml b/proto-google-cloud-functions-v1/pom.xml index 8cc124bf..d58a9598 100644 --- a/proto-google-cloud-functions-v1/pom.xml +++ b/proto-google-cloud-functions-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v1 - 2.4.4-SNAPSHOT + 2.5.0 proto-google-cloud-functions-v1 PROTO library for proto-google-cloud-functions-v1 com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/proto-google-cloud-functions-v2/pom.xml b/proto-google-cloud-functions-v2/pom.xml index 21d06673..b349d01e 100644 --- a/proto-google-cloud-functions-v2/pom.xml +++ b/proto-google-cloud-functions-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v2 - 2.4.4-SNAPSHOT + 2.5.0 proto-google-cloud-functions-v2 Proto library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/proto-google-cloud-functions-v2alpha/pom.xml b/proto-google-cloud-functions-v2alpha/pom.xml index 94c2fb68..1117605f 100644 --- a/proto-google-cloud-functions-v2alpha/pom.xml +++ b/proto-google-cloud-functions-v2alpha/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v2alpha - 2.4.4-SNAPSHOT + 2.5.0 proto-google-cloud-functions-v2alpha Proto library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/proto-google-cloud-functions-v2beta/pom.xml b/proto-google-cloud-functions-v2beta/pom.xml index 346333e6..fe5a4024 100644 --- a/proto-google-cloud-functions-v2beta/pom.xml +++ b/proto-google-cloud-functions-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-functions-v2beta - 2.4.4-SNAPSHOT + 2.5.0 proto-google-cloud-functions-v2beta Proto library for google-cloud-functions com.google.cloud google-cloud-functions-parent - 2.4.4-SNAPSHOT + 2.5.0 diff --git a/versions.txt b/versions.txt index 69b5dc12..4ecb6a39 100644 --- a/versions.txt +++ b/versions.txt @@ -1,12 +1,12 @@ # Format: # module:released-version:current-version -google-cloud-functions:2.4.3:2.4.4-SNAPSHOT -grpc-google-cloud-functions-v1:2.4.3:2.4.4-SNAPSHOT -proto-google-cloud-functions-v1:2.4.3:2.4.4-SNAPSHOT -proto-google-cloud-functions-v2beta:2.4.3:2.4.4-SNAPSHOT -proto-google-cloud-functions-v2alpha:2.4.3:2.4.4-SNAPSHOT -grpc-google-cloud-functions-v2beta:2.4.3:2.4.4-SNAPSHOT -grpc-google-cloud-functions-v2alpha:2.4.3:2.4.4-SNAPSHOT -proto-google-cloud-functions-v2:2.4.3:2.4.4-SNAPSHOT -grpc-google-cloud-functions-v2:2.4.3:2.4.4-SNAPSHOT +google-cloud-functions:2.5.0:2.5.0 +grpc-google-cloud-functions-v1:2.5.0:2.5.0 +proto-google-cloud-functions-v1:2.5.0:2.5.0 +proto-google-cloud-functions-v2beta:2.5.0:2.5.0 +proto-google-cloud-functions-v2alpha:2.5.0:2.5.0 +grpc-google-cloud-functions-v2beta:2.5.0:2.5.0 +grpc-google-cloud-functions-v2alpha:2.5.0:2.5.0 +proto-google-cloud-functions-v2:2.5.0:2.5.0 +grpc-google-cloud-functions-v2:2.5.0:2.5.0