From 0ebf4af22c0f4269cfe5fa9cfc5a10005389b1f5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 17:40:20 +0000 Subject: [PATCH] feat: [cloudfunctions] added helper methods for long running operations, IAM, and locations (#9421) - [ ] Regenerate this pull request now. docs: clarified that vpcConnector shortname is only returned if the connector is in the same project as the function docs: applied general style guide updates to descriptions PiperOrigin-RevId: 530688922 Source-Link: https://togithub.com/googleapis/googleapis/commit/a540c8aef871694f9489aecb594023817e713d54 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/dca7c4dd03c0db64c5626c84c7309ce4eee4b967 Copy-Tag: eyJwIjoiamF2YS1mdW5jdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6ImRjYTdjNGRkMDNjMGRiNjRjNTYyNmM4NGM3MzA5Y2U0ZWVlNGI5NjcifQ== --- java-functions/README.md | 4 +- .../v1/CloudFunctionsServiceClient.java | 229 ++++++++++- .../v1/CloudFunctionsServiceSettings.java | 16 + .../cloud/functions/v1/gapic_metadata.json | 3 + .../v1/stub/CloudFunctionsServiceStub.java | 12 + .../CloudFunctionsServiceStubSettings.java | 90 ++++- .../stub/GrpcCloudFunctionsServiceStub.java | 44 +++ .../HttpJsonCloudFunctionsServiceStub.java | 64 +++ ...oudFunctionsServiceClientHttpJsonTest.java | 66 ++++ .../v1/CloudFunctionsServiceClientTest.java | 70 +++- .../cloud/functions/v1/MockIAMPolicy.java | 59 +++ .../cloud/functions/v1/MockIAMPolicyImpl.java | 59 +++ .../cloud/functions/v1/MockLocations.java | 59 +++ .../cloud/functions/v1/MockLocationsImpl.java | 83 ++++ .../v1/CloudFunctionsServiceGrpc.java | 56 +-- .../cloud/functions/v1/CloudFunction.java | 346 +++++++++-------- .../functions/v1/CloudFunctionOrBuilder.java | 84 ++-- .../functions/v1/CreateFunctionRequest.java | 28 +- .../v1/CreateFunctionRequestOrBuilder.java | 8 +- .../cloud/functions/v1/EventTrigger.java | 32 +- .../functions/v1/EventTriggerOrBuilder.java | 8 +- .../cloud/functions/v1/FailurePolicy.java | 36 +- .../functions/v1/FailurePolicyOrBuilder.java | 6 +- .../cloud/functions/v1/FunctionsProto.java | 366 +++++++++--------- .../cloud/functions/v1/HttpsTrigger.java | 18 +- .../functions/v1/HttpsTriggerOrBuilder.java | 4 +- .../cloud/functions/v1/SecretEnvVar.java | 60 +-- .../functions/v1/SecretEnvVarOrBuilder.java | 16 +- .../cloud/functions/v1/SecretVolume.java | 196 +++++----- .../functions/v1/SecretVolumeOrBuilder.java | 34 +- .../cloud/functions/v1/SourceRepository.java | 14 +- .../v1/SourceRepositoryOrBuilder.java | 4 +- .../google/cloud/functions/v1/functions.proto | 205 +++++----- .../cloud/functions/v1/operations.proto | 2 +- .../listlocations/AsyncListLocations.java | 55 +++ .../AsyncListLocationsPaged.java | 63 +++ .../listlocations/SyncListLocations.java | 51 +++ 37 files changed, 1773 insertions(+), 777 deletions(-) create mode 100644 java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockIAMPolicy.java create mode 100644 java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockIAMPolicyImpl.java create mode 100644 java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockLocations.java create mode 100644 java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/MockLocationsImpl.java create mode 100644 java-functions/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsservice/listlocations/AsyncListLocations.java create mode 100644 java-functions/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsservice/listlocations/AsyncListLocationsPaged.java create mode 100644 java-functions/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsservice/listlocations/SyncListLocations.java diff --git a/java-functions/README.md b/java-functions/README.md index 33a9f451b4e2..55e225de3734 100644 --- a/java-functions/README.md +++ b/java-functions/README.md @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.11.0 + 26.14.0 pom import @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-functions.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-functions/2.16.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-functions/2.18.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java index 64ea22ff0bed..4157b3743e6c 100644 --- a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java +++ b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java @@ -30,6 +30,9 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.functions.v1.stub.CloudFunctionsServiceStub; import com.google.cloud.functions.v1.stub.CloudFunctionsServiceStubSettings; +import com.google.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; @@ -436,7 +439,7 @@ public final UnaryCallable getFunctionCallabl // 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. + * project, the long running operation returns an `ALREADY_EXISTS` error. * *

Sample code: * @@ -473,7 +476,7 @@ public final OperationFuture createFunctionA // 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. + * project, the long running operation returns an `ALREADY_EXISTS` error. * *

Sample code: * @@ -507,7 +510,7 @@ public final OperationFuture createFunctionA // 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. + * project, the long running operation returns an `ALREADY_EXISTS` error. * *

Sample code: * @@ -539,7 +542,7 @@ public final OperationFuture createFunctionA // 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. + * project, the long running operation returns an `ALREADY_EXISTS` error. * *

Sample code: * @@ -571,7 +574,7 @@ public final OperationFuture createFunctionA // 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. + * project, the long running operation returns an `ALREADY_EXISTS` error. * *

Sample code: * @@ -723,7 +726,7 @@ public final UnaryCallable updateFunctionCalla // 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. + * used by some trigger, the trigger is updated to remove this function. * *

Sample code: * @@ -753,7 +756,7 @@ public final OperationFuture deleteFunctionAsync( // 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. + * used by some trigger, the trigger is updated to remove this function. * *

Sample code: * @@ -781,7 +784,7 @@ public final OperationFuture deleteFunctionAsync(Str // 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. + * used by some trigger, the trigger is updated to remove this function. * *

Sample code: * @@ -812,7 +815,7 @@ public final OperationFuture deleteFunctionAsync( // 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. + * used by some trigger, the trigger is updated to remove this function. * *

Sample code: * @@ -843,7 +846,7 @@ public final OperationFuture deleteFunctionAsync( // 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. + * used by some trigger, the trigger is updated to remove this function. * *

Sample code: * @@ -1019,14 +1022,14 @@ public final UnaryCallable callFuncti * the URL. * * - *

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

When making an HTTP PUT request, these two headers must be specified: * *

* - *

And this header SHOULD NOT be specified: + *

And this header must NOT be specified: * *

* - *

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

When making an HTTP PUT request, these two headers must be specified: * *

* - *

And this header SHOULD NOT be specified: + *

And this header must NOT be specified: * *