diff --git a/java-functions/README.md b/java-functions/README.md index 9066f09dfc6c..6807851e340a 100644 --- a/java-functions/README.md +++ b/java-functions/README.md @@ -14,7 +14,6 @@ Java idiomatic client for [Cloud Functions][product-docs]. If you are using Maven, add this to your pom.xml file: - ```xml @@ -35,7 +34,6 @@ If you are using SBT, add this to your dependencies: ```Scala libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "2.14.0" ``` - ## Authentication diff --git a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceStub.java b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceStub.java index c142008bb85c..5a748e945cb5 100644 --- a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceStub.java +++ b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; +import com.google.api.HttpRule; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -47,6 +48,7 @@ import com.google.cloud.functions.v1.ListFunctionsResponse; import com.google.cloud.functions.v1.OperationMetadataV1; import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.common.collect.ImmutableMap; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -559,7 +561,18 @@ protected HttpJsonCloudFunctionsServiceStub( throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1/{name=operations/*}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1/operations").build()) + .build()); HttpJsonCallSettings listFunctionsTransportSettings = diff --git a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java index 48fa3d6c06e5..822930cbc3f3 100644 --- a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java +++ b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/FunctionServiceClient.java @@ -987,6 +987,9 @@ public final UnaryCallable deleteFunctionCalla * GenerateUploadUrlRequest request = * GenerateUploadUrlRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setKmsKeyName( + * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + * .toString()) * .build(); * GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request); * } @@ -1040,6 +1043,9 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques * GenerateUploadUrlRequest request = * GenerateUploadUrlRequest.newBuilder() * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setKmsKeyName( + * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + * .toString()) * .build(); * ApiFuture future = * functionServiceClient.generateUploadUrlCallable().futureCall(request); diff --git a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java index 2bb378c47ee0..698bb304d492 100644 --- a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java +++ b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2/stub/HttpJsonFunctionServiceStub.java @@ -19,6 +19,7 @@ import static com.google.cloud.functions.v2.FunctionServiceClient.ListFunctionsPagedResponse; import static com.google.cloud.functions.v2.FunctionServiceClient.ListLocationsPagedResponse; +import com.google.api.HttpRule; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -50,6 +51,7 @@ 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; @@ -594,7 +596,22 @@ protected HttpJsonFunctionServiceStub( throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v2/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v2/{name=projects/*/locations/*}/operations") + .build()) + .build()); HttpJsonCallSettings getFunctionTransportSettings = HttpJsonCallSettings.newBuilder() diff --git a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceStub.java b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceStub.java index 0b7e8184555f..dca214532432 100644 --- a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceStub.java +++ b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceStub.java @@ -19,6 +19,7 @@ import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; +import com.google.api.HttpRule; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -50,6 +51,7 @@ import com.google.cloud.functions.v2alpha.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; @@ -595,7 +597,22 @@ protected HttpJsonFunctionServiceStub( throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*/locations/*}/operations") + .build()) + .build()); HttpJsonCallSettings getFunctionTransportSettings = HttpJsonCallSettings.newBuilder() diff --git a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceStub.java b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceStub.java index c14db4065fb8..5b5b92d6e320 100644 --- a/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceStub.java +++ b/java-functions/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceStub.java @@ -19,6 +19,7 @@ import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; +import com.google.api.HttpRule; import com.google.api.core.BetaApi; import com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -50,6 +51,7 @@ import com.google.cloud.functions.v2beta.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; @@ -595,7 +597,22 @@ protected HttpJsonFunctionServiceStub( throws IOException { this.callableFactory = callableFactory; this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*/locations/*}/operations") + .build()) + .build()); HttpJsonCallSettings getFunctionTransportSettings = HttpJsonCallSettings.newBuilder() diff --git a/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java b/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java index ecee9e1f26ec..49a722196a78 100644 --- a/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java +++ b/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientHttpJsonTest.java @@ -109,6 +109,10 @@ public void getFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); mockService.addResponse(expectedResponse); @@ -161,6 +165,10 @@ public void getFunctionTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); mockService.addResponse(expectedResponse); @@ -313,6 +321,10 @@ public void createFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); Operation resultOperation = Operation.newBuilder() @@ -374,6 +386,10 @@ public void createFunctionTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); Operation resultOperation = Operation.newBuilder() @@ -435,6 +451,10 @@ public void updateFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); Operation resultOperation = Operation.newBuilder() @@ -455,6 +475,10 @@ public void updateFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -495,6 +519,10 @@ public void updateFunctionExceptionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateFunctionAsync(function, updateMask).get(); @@ -605,6 +633,9 @@ public void generateUploadUrlTest() throws Exception { GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .build(); GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); @@ -636,6 +667,9 @@ public void generateUploadUrlExceptionTest() throws Exception { GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .build(); client.generateUploadUrl(request); Assert.fail("No exception raised"); diff --git a/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java b/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java index b16a30f90d82..137ecfe4e7e1 100644 --- a/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java +++ b/java-functions/google-cloud-functions/src/test/java/com/google/cloud/functions/v2/FunctionServiceClientTest.java @@ -118,6 +118,10 @@ public void getFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); mockFunctionService.addResponse(expectedResponse); @@ -164,6 +168,10 @@ public void getFunctionTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); mockFunctionService.addResponse(expectedResponse); @@ -298,6 +306,10 @@ public void createFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); Operation resultOperation = Operation.newBuilder() @@ -358,6 +370,10 @@ public void createFunctionTest2() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); Operation resultOperation = Operation.newBuilder() @@ -418,6 +434,10 @@ public void updateFunctionTest() throws Exception { .setUpdateTime(Timestamp.newBuilder().build()) .putAllLabels(new HashMap()) .addAllStateMessages(new ArrayList()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setUrl("url116079") .build(); Operation resultOperation = Operation.newBuilder() @@ -558,6 +578,9 @@ public void generateUploadUrlTest() throws Exception { GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .build(); GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); @@ -568,6 +591,7 @@ public void generateUploadUrlTest() throws Exception { GenerateUploadUrlRequest actualRequest = ((GenerateUploadUrlRequest) actualRequests.get(0)); Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getKmsKeyName(), actualRequest.getKmsKeyName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -583,6 +607,9 @@ public void generateUploadUrlExceptionTest() throws Exception { GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .build(); client.generateUploadUrl(request); Assert.fail("No exception raised"); diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java index 9f3f299a41d3..83f7e3498953 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfig.java @@ -43,6 +43,7 @@ private BuildConfig() { runtime_ = ""; entryPoint_ = ""; workerPool_ = ""; + dockerRegistry_ = 0; dockerRepository_ = ""; } @@ -83,6 +84,173 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.cloud.functions.v2.BuildConfig.Builder.class); } + /** + * + * + *
+   * Docker Registry to use for storing function Docker images.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.BuildConfig.DockerRegistry} + */ + public enum DockerRegistry implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * DOCKER_REGISTRY_UNSPECIFIED = 0; + */ + DOCKER_REGISTRY_UNSPECIFIED(0), + /** + * + * + *
+     * Docker images will be stored in multi-regional Container Registry
+     * repositories named `gcf`.
+     * 
+ * + * CONTAINER_REGISTRY = 1; + */ + CONTAINER_REGISTRY(1), + /** + * + * + *
+     * Docker images will be stored in regional Artifact Registry repositories.
+     * By default, GCF will create and use repositories named `gcf-artifacts`
+     * in every region in which a function is deployed. But the repository to
+     * use can also be specified by the user using the `docker_repository`
+     * field.
+     * 
+ * + * ARTIFACT_REGISTRY = 2; + */ + ARTIFACT_REGISTRY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * DOCKER_REGISTRY_UNSPECIFIED = 0; + */ + public static final int DOCKER_REGISTRY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Docker images will be stored in multi-regional Container Registry
+     * repositories named `gcf`.
+     * 
+ * + * CONTAINER_REGISTRY = 1; + */ + public static final int CONTAINER_REGISTRY_VALUE = 1; + /** + * + * + *
+     * Docker images will be stored in regional Artifact Registry repositories.
+     * By default, GCF will create and use repositories named `gcf-artifacts`
+     * in every region in which a function is deployed. But the repository to
+     * use can also be specified by the user using the `docker_repository`
+     * field.
+     * 
+ * + * ARTIFACT_REGISTRY = 2; + */ + public static final int ARTIFACT_REGISTRY_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 DockerRegistry 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 DockerRegistry forNumber(int value) { + switch (value) { + case 0: + return DOCKER_REGISTRY_UNSPECIFIED; + case 1: + return CONTAINER_REGISTRY; + case 2: + return ARTIFACT_REGISTRY; + 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 DockerRegistry findValueByNumber(int number) { + return DockerRegistry.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.BuildConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final DockerRegistry[] VALUES = values(); + + public static DockerRegistry 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 DockerRegistry(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.BuildConfig.DockerRegistry) + } + public static final int BUILD_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -91,8 +259,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { * * *
-   * Output only. The Cloud Build name of the latest successful deployment of the
-   * function.
+   * Output only. The Cloud Build name of the latest successful deployment of
+   * the function.
    * 
* * @@ -117,8 +285,8 @@ public java.lang.String getBuild() { * * *
-   * Output only. The Cloud Build name of the latest successful deployment of the
-   * function.
+   * Output only. The Cloud Build name of the latest successful deployment of
+   * the function.
    * 
* * @@ -539,6 +707,59 @@ public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { return map.get(key); } + public static final int DOCKER_REGISTRY_FIELD_NUMBER = 10; + private int dockerRegistry_ = 0; + /** + * + * + *
+   * Optional. Docker Registry to use for this deployment. This configuration is
+   * only applicable to 1st Gen functions, 2nd Gen functions can only use
+   * Artifact Registry.
+   * If `docker_repository` field is specified, this field will be automatically
+   * set as `ARTIFACT_REGISTRY`.
+   * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+   * This field may be overridden by the backend for eligible deployments.
+   * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for dockerRegistry. + */ + @java.lang.Override + public int getDockerRegistryValue() { + return dockerRegistry_; + } + /** + * + * + *
+   * Optional. Docker Registry to use for this deployment. This configuration is
+   * only applicable to 1st Gen functions, 2nd Gen functions can only use
+   * Artifact Registry.
+   * If `docker_repository` field is specified, this field will be automatically
+   * set as `ARTIFACT_REGISTRY`.
+   * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+   * This field may be overridden by the backend for eligible deployments.
+   * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dockerRegistry. + */ + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfig.DockerRegistry getDockerRegistry() { + com.google.cloud.functions.v2.BuildConfig.DockerRegistry result = + com.google.cloud.functions.v2.BuildConfig.DockerRegistry.forNumber(dockerRegistry_); + return result == null + ? com.google.cloud.functions.v2.BuildConfig.DockerRegistry.UNRECOGNIZED + : result; + } + public static final int DOCKER_REPOSITORY_FIELD_NUMBER = 7; @SuppressWarnings("serial") @@ -547,7 +768,7 @@ public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { * * *
-   * Optional. User managed repository created in Artifact Registry optionally with a
+   * 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'
@@ -559,9 +780,7 @@ public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) {
    * Repository format must be 'DOCKER'.
    * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return The dockerRepository. */ @@ -581,7 +800,7 @@ public java.lang.String getDockerRepository() { * * *
-   * Optional. User managed repository created in Artifact Registry optionally with a
+   * 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'
@@ -593,9 +812,7 @@ public java.lang.String getDockerRepository() {
    * Repository format must be 'DOCKER'.
    * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return The bytes for dockerRepository. */ @@ -652,6 +869,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceProvenance_ != null) { output.writeMessage(8, getSourceProvenance()); } + if (dockerRegistry_ + != com.google.cloud.functions.v2.BuildConfig.DockerRegistry.DOCKER_REGISTRY_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, dockerRegistry_); + } getUnknownFields().writeTo(output); } @@ -692,6 +914,11 @@ public int getSerializedSize() { if (sourceProvenance_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSourceProvenance()); } + if (dockerRegistry_ + != com.google.cloud.functions.v2.BuildConfig.DockerRegistry.DOCKER_REGISTRY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, dockerRegistry_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -722,6 +949,7 @@ public boolean equals(final java.lang.Object obj) { if (!getWorkerPool().equals(other.getWorkerPool())) return false; if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) return false; + if (dockerRegistry_ != other.dockerRegistry_) return false; if (!getDockerRepository().equals(other.getDockerRepository())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; @@ -754,6 +982,8 @@ public int hashCode() { hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); } + hash = (37 * hash) + DOCKER_REGISTRY_FIELD_NUMBER; + hash = (53 * hash) + dockerRegistry_; hash = (37 * hash) + DOCKER_REPOSITORY_FIELD_NUMBER; hash = (53 * hash) + getDockerRepository().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); @@ -931,6 +1161,7 @@ public Builder clear() { } workerPool_ = ""; internalGetMutableEnvironmentVariables().clear(); + dockerRegistry_ = 0; dockerRepository_ = ""; return this; } @@ -992,6 +1223,9 @@ private void buildPartial0(com.google.cloud.functions.v2.BuildConfig result) { result.environmentVariables_.makeImmutable(); } if (((from_bitField0_ & 0x00000080) != 0)) { + result.dockerRegistry_ = dockerRegistry_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { result.dockerRepository_ = dockerRepository_; } } @@ -1069,9 +1303,12 @@ public Builder mergeFrom(com.google.cloud.functions.v2.BuildConfig other) { } internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); bitField0_ |= 0x00000040; + if (other.dockerRegistry_ != 0) { + setDockerRegistryValue(other.getDockerRegistryValue()); + } if (!other.getDockerRepository().isEmpty()) { dockerRepository_ = other.dockerRepository_; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); @@ -1146,7 +1383,7 @@ public Builder mergeFrom( case 58: { dockerRepository_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 58 case 66: @@ -1156,6 +1393,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000010; break; } // case 66 + case 80: + { + dockerRegistry_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 80 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1180,8 +1423,8 @@ public Builder mergeFrom( * * *
-     * Output only. The Cloud Build name of the latest successful deployment of the
-     * function.
+     * Output only. The Cloud Build name of the latest successful deployment of
+     * the function.
      * 
* * @@ -1205,8 +1448,8 @@ public java.lang.String getBuild() { * * *
-     * Output only. The Cloud Build name of the latest successful deployment of the
-     * function.
+     * Output only. The Cloud Build name of the latest successful deployment of
+     * the function.
      * 
* * @@ -1230,8 +1473,8 @@ public com.google.protobuf.ByteString getBuildBytes() { * * *
-     * Output only. The Cloud Build name of the latest successful deployment of the
-     * function.
+     * Output only. The Cloud Build name of the latest successful deployment of
+     * the function.
      * 
* * @@ -1254,8 +1497,8 @@ public Builder setBuild(java.lang.String value) { * * *
-     * Output only. The Cloud Build name of the latest successful deployment of the
-     * function.
+     * Output only. The Cloud Build name of the latest successful deployment of
+     * the function.
      * 
* * @@ -1274,8 +1517,8 @@ public Builder clearBuild() { * * *
-     * Output only. The Cloud Build name of the latest successful deployment of the
-     * function.
+     * Output only. The Cloud Build name of the latest successful deployment of
+     * the function.
      * 
* * @@ -2265,12 +2508,145 @@ public Builder putAllEnvironmentVariables( return this; } + private int dockerRegistry_ = 0; + /** + * + * + *
+     * Optional. Docker Registry to use for this deployment. This configuration is
+     * only applicable to 1st Gen functions, 2nd Gen functions can only use
+     * Artifact Registry.
+     * If `docker_repository` field is specified, this field will be automatically
+     * set as `ARTIFACT_REGISTRY`.
+     * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+     * This field may be overridden by the backend for eligible deployments.
+     * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for dockerRegistry. + */ + @java.lang.Override + public int getDockerRegistryValue() { + return dockerRegistry_; + } + /** + * + * + *
+     * Optional. Docker Registry to use for this deployment. This configuration is
+     * only applicable to 1st Gen functions, 2nd Gen functions can only use
+     * Artifact Registry.
+     * If `docker_repository` field is specified, this field will be automatically
+     * set as `ARTIFACT_REGISTRY`.
+     * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+     * This field may be overridden by the backend for eligible deployments.
+     * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for dockerRegistry to set. + * @return This builder for chaining. + */ + public Builder setDockerRegistryValue(int value) { + dockerRegistry_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Docker Registry to use for this deployment. This configuration is
+     * only applicable to 1st Gen functions, 2nd Gen functions can only use
+     * Artifact Registry.
+     * If `docker_repository` field is specified, this field will be automatically
+     * set as `ARTIFACT_REGISTRY`.
+     * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+     * This field may be overridden by the backend for eligible deployments.
+     * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dockerRegistry. + */ + @java.lang.Override + public com.google.cloud.functions.v2.BuildConfig.DockerRegistry getDockerRegistry() { + com.google.cloud.functions.v2.BuildConfig.DockerRegistry result = + com.google.cloud.functions.v2.BuildConfig.DockerRegistry.forNumber(dockerRegistry_); + return result == null + ? com.google.cloud.functions.v2.BuildConfig.DockerRegistry.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Docker Registry to use for this deployment. This configuration is
+     * only applicable to 1st Gen functions, 2nd Gen functions can only use
+     * Artifact Registry.
+     * If `docker_repository` field is specified, this field will be automatically
+     * set as `ARTIFACT_REGISTRY`.
+     * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+     * This field may be overridden by the backend for eligible deployments.
+     * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The dockerRegistry to set. + * @return This builder for chaining. + */ + public Builder setDockerRegistry( + com.google.cloud.functions.v2.BuildConfig.DockerRegistry value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + dockerRegistry_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Docker Registry to use for this deployment. This configuration is
+     * only applicable to 1st Gen functions, 2nd Gen functions can only use
+     * Artifact Registry.
+     * If `docker_repository` field is specified, this field will be automatically
+     * set as `ARTIFACT_REGISTRY`.
+     * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+     * This field may be overridden by the backend for eligible deployments.
+     * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDockerRegistry() { + bitField0_ = (bitField0_ & ~0x00000080); + dockerRegistry_ = 0; + onChanged(); + return this; + } + private java.lang.Object dockerRepository_ = ""; /** * * *
-     * Optional. User managed repository created in Artifact Registry optionally with a
+     * 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'
@@ -2282,9 +2658,7 @@ public Builder putAllEnvironmentVariables(
      * Repository format must be 'DOCKER'.
      * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return The dockerRepository. */ @@ -2303,7 +2677,7 @@ public java.lang.String getDockerRepository() { * * *
-     * Optional. User managed repository created in Artifact Registry optionally with a
+     * 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'
@@ -2315,9 +2689,7 @@ public java.lang.String getDockerRepository() {
      * Repository format must be 'DOCKER'.
      * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return The bytes for dockerRepository. */ @@ -2336,7 +2708,7 @@ public com.google.protobuf.ByteString getDockerRepositoryBytes() { * * *
-     * Optional. User managed repository created in Artifact Registry optionally with a
+     * 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'
@@ -2348,9 +2720,7 @@ public com.google.protobuf.ByteString getDockerRepositoryBytes() {
      * Repository format must be 'DOCKER'.
      * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @param value The dockerRepository to set. * @return This builder for chaining. @@ -2360,7 +2730,7 @@ public Builder setDockerRepository(java.lang.String value) { throw new NullPointerException(); } dockerRepository_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2368,7 +2738,7 @@ public Builder setDockerRepository(java.lang.String value) { * * *
-     * Optional. User managed repository created in Artifact Registry optionally with a
+     * 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'
@@ -2380,15 +2750,13 @@ public Builder setDockerRepository(java.lang.String value) {
      * Repository format must be 'DOCKER'.
      * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return This builder for chaining. */ public Builder clearDockerRepository() { dockerRepository_ = getDefaultInstance().getDockerRepository(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); onChanged(); return this; } @@ -2396,7 +2764,7 @@ public Builder clearDockerRepository() { * * *
-     * Optional. User managed repository created in Artifact Registry optionally with a
+     * 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'
@@ -2408,9 +2776,7 @@ public Builder clearDockerRepository() {
      * Repository format must be 'DOCKER'.
      * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @param value The bytes for dockerRepository to set. * @return This builder for chaining. @@ -2421,7 +2787,7 @@ public Builder setDockerRepositoryBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); dockerRepository_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java index c4f19c01c289..ba39ba0594fd 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/BuildConfigOrBuilder.java @@ -27,8 +27,8 @@ public interface BuildConfigOrBuilder * * *
-   * Output only. The Cloud Build name of the latest successful deployment of the
-   * function.
+   * Output only. The Cloud Build name of the latest successful deployment of
+   * the function.
    * 
* * @@ -42,8 +42,8 @@ public interface BuildConfigOrBuilder * * *
-   * Output only. The Cloud Build name of the latest successful deployment of the
-   * function.
+   * Output only. The Cloud Build name of the latest successful deployment of
+   * the function.
    * 
* * @@ -305,7 +305,48 @@ java.lang.String getEnvironmentVariablesOrDefault( * * *
-   * Optional. User managed repository created in Artifact Registry optionally with a
+   * Optional. Docker Registry to use for this deployment. This configuration is
+   * only applicable to 1st Gen functions, 2nd Gen functions can only use
+   * Artifact Registry.
+   * If `docker_repository` field is specified, this field will be automatically
+   * set as `ARTIFACT_REGISTRY`.
+   * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+   * This field may be overridden by the backend for eligible deployments.
+   * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for dockerRegistry. + */ + int getDockerRegistryValue(); + /** + * + * + *
+   * Optional. Docker Registry to use for this deployment. This configuration is
+   * only applicable to 1st Gen functions, 2nd Gen functions can only use
+   * Artifact Registry.
+   * If `docker_repository` field is specified, this field will be automatically
+   * set as `ARTIFACT_REGISTRY`.
+   * If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
+   * This field may be overridden by the backend for eligible deployments.
+   * 
+ * + * + * .google.cloud.functions.v2.BuildConfig.DockerRegistry docker_registry = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The dockerRegistry. + */ + com.google.cloud.functions.v2.BuildConfig.DockerRegistry getDockerRegistry(); + + /** + * + * + *
+   * 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'
@@ -317,9 +358,7 @@ java.lang.String getEnvironmentVariablesOrDefault(
    * Repository format must be 'DOCKER'.
    * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return The dockerRepository. */ @@ -328,7 +367,7 @@ java.lang.String getEnvironmentVariablesOrDefault( * * *
-   * Optional. User managed repository created in Artifact Registry optionally with a
+   * 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'
@@ -340,9 +379,7 @@ java.lang.String getEnvironmentVariablesOrDefault(
    * Repository format must be 'DOCKER'.
    * 
* - * - * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } - * + * string docker_repository = 7 [(.google.api.resource_reference) = { ... } * * @return The bytes for dockerRepository. */ diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java index a06e2ec65b97..ba530f51f4ec 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequest.java @@ -76,8 +76,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The project and location in which the function should be created, specified
-   * in the format `projects/*/locations/*`
+   * Required. The project and location in which the function should be created,
+   * specified in the format `projects/*/locations/*`
    * 
* * @@ -102,8 +102,8 @@ public java.lang.String getParent() { * * *
-   * Required. The project and location in which the function should be created, specified
-   * in the format `projects/*/locations/*`
+   * Required. The project and location in which the function should be created,
+   * specified in the format `projects/*/locations/*`
    * 
* * @@ -640,8 +640,8 @@ public Builder mergeFrom( * * *
-     * Required. The project and location in which the function should be created, specified
-     * in the format `projects/*/locations/*`
+     * Required. The project and location in which the function should be created,
+     * specified in the format `projects/*/locations/*`
      * 
* * @@ -665,8 +665,8 @@ public java.lang.String getParent() { * * *
-     * Required. The project and location in which the function should be created, specified
-     * in the format `projects/*/locations/*`
+     * Required. The project and location in which the function should be created,
+     * specified in the format `projects/*/locations/*`
      * 
* * @@ -690,8 +690,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The project and location in which the function should be created, specified
-     * in the format `projects/*/locations/*`
+     * Required. The project and location in which the function should be created,
+     * specified in the format `projects/*/locations/*`
      * 
* * @@ -714,8 +714,8 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The project and location in which the function should be created, specified
-     * in the format `projects/*/locations/*`
+     * Required. The project and location in which the function should be created,
+     * specified in the format `projects/*/locations/*`
      * 
* * @@ -734,8 +734,8 @@ public Builder clearParent() { * * *
-     * Required. The project and location in which the function should be created, specified
-     * in the format `projects/*/locations/*`
+     * Required. The project and location in which the function should be created,
+     * specified in the format `projects/*/locations/*`
      * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java index f287ab5e57bc..676109858ea7 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CreateFunctionRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface CreateFunctionRequestOrBuilder * * *
-   * Required. The project and location in which the function should be created, specified
-   * in the format `projects/*/locations/*`
+   * Required. The project and location in which the function should be created,
+   * specified in the format `projects/*/locations/*`
    * 
* * @@ -42,8 +42,8 @@ public interface CreateFunctionRequestOrBuilder * * *
-   * Required. The project and location in which the function should be created, specified
-   * in the format `projects/*/locations/*`
+   * Required. The project and location in which the function should be created,
+   * specified in the format `projects/*/locations/*`
    * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CryptoKeyName.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CryptoKeyName.java new file mode 100644 index 000000000000..8fa829024f87 --- /dev/null +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/CryptoKeyName.java @@ -0,0 +1,261 @@ +/* + * 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 CryptoKeyName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_KEY_RING_CRYPTO_KEY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String keyRing; + private final String cryptoKey; + + @Deprecated + protected CryptoKeyName() { + project = null; + location = null; + keyRing = null; + cryptoKey = null; + } + + private CryptoKeyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + keyRing = Preconditions.checkNotNull(builder.getKeyRing()); + cryptoKey = Preconditions.checkNotNull(builder.getCryptoKey()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getKeyRing() { + return keyRing; + } + + public String getCryptoKey() { + return cryptoKey; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CryptoKeyName of( + String project, String location, String keyRing, String cryptoKey) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setKeyRing(keyRing) + .setCryptoKey(cryptoKey) + .build(); + } + + public static String format(String project, String location, String keyRing, String cryptoKey) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setKeyRing(keyRing) + .setCryptoKey(cryptoKey) + .build() + .toString(); + } + + public static CryptoKeyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.validatedMatch( + formattedString, "CryptoKeyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("key_ring"), + matchMap.get("crypto_key")); + } + + 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 (CryptoKeyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.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 (keyRing != null) { + fieldMapBuilder.put("key_ring", keyRing); + } + if (cryptoKey != null) { + fieldMapBuilder.put("crypto_key", cryptoKey); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.instantiate( + "project", project, "location", location, "key_ring", keyRing, "crypto_key", cryptoKey); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CryptoKeyName that = ((CryptoKeyName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.keyRing, that.keyRing) + && Objects.equals(this.cryptoKey, that.cryptoKey); + } + 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(keyRing); + h *= 1000003; + h ^= Objects.hashCode(cryptoKey); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. + */ + public static class Builder { + private String project; + private String location; + private String keyRing; + private String cryptoKey; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getKeyRing() { + return keyRing; + } + + public String getCryptoKey() { + return cryptoKey; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setKeyRing(String keyRing) { + this.keyRing = keyRing; + return this; + } + + public Builder setCryptoKey(String cryptoKey) { + this.cryptoKey = cryptoKey; + return this; + } + + private Builder(CryptoKeyName cryptoKeyName) { + this.project = cryptoKeyName.project; + this.location = cryptoKeyName.location; + this.keyRing = cryptoKeyName.keyRing; + this.cryptoKey = cryptoKeyName.cryptoKey; + } + + public CryptoKeyName build() { + return new CryptoKeyName(this); + } + } +} diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java index 8482bdb4c52f..11786dd2bfeb 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTrigger.java @@ -243,8 +243,8 @@ private RetryPolicy(int value) { * * *
-   * Output only. The resource name of the Eventarc trigger. The format of this field is
-   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * Output only. The resource name of the Eventarc trigger. The format of this
+   * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
    * 
* * @@ -269,8 +269,8 @@ public 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}`.
+   * Output only. The resource name of the Eventarc trigger. The format of this
+   * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
    * 
* * @@ -548,8 +548,8 @@ public 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
+   * 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`.
@@ -575,8 +575,8 @@ public 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
+   * 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`.
@@ -605,7 +605,8 @@ public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
    *
    *
    * 
-   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+   * them).
    * 
* * @@ -622,7 +623,8 @@ public int getRetryPolicyValue() { * * *
-   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+   * them).
    * 
* * @@ -1263,8 +1265,8 @@ public Builder mergeFrom( * * *
-     * Output only. The resource name of the Eventarc trigger. The format of this field is
-     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * Output only. The resource name of the Eventarc trigger. The format of this
+     * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
      * 
* * @@ -1288,8 +1290,8 @@ public 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}`.
+     * Output only. The resource name of the Eventarc trigger. The format of this
+     * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
      * 
* * @@ -1313,8 +1315,8 @@ public com.google.protobuf.ByteString getTriggerBytes() { * * *
-     * Output only. The resource name of the Eventarc trigger. The format of this field is
-     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * Output only. The resource name of the Eventarc trigger. The format of this
+     * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
      * 
* * @@ -1337,8 +1339,8 @@ public Builder setTrigger(java.lang.String value) { * * *
-     * Output only. The resource name of the Eventarc trigger. The format of this field is
-     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * Output only. The resource name of the Eventarc trigger. The format of this
+     * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
      * 
* * @@ -1357,8 +1359,8 @@ public Builder clearTrigger() { * * *
-     * Output only. The resource name of the Eventarc trigger. The format of this field is
-     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * Output only. The resource name of the Eventarc trigger. The format of this
+     * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
      * 
* * @@ -2113,8 +2115,8 @@ public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { * * *
-     * Optional. The email of the trigger's service account. The service account must have
-     * permission to invoke Cloud Run services, the permission is
+     * 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`.
@@ -2139,8 +2141,8 @@ public 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
+     * 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`.
@@ -2165,8 +2167,8 @@ public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
      *
      *
      * 
-     * Optional. The email of the trigger's service account. The service account must have
-     * permission to invoke Cloud Run services, the permission is
+     * 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`.
@@ -2190,8 +2192,8 @@ public Builder setServiceAccountEmail(java.lang.String value) {
      *
      *
      * 
-     * Optional. The email of the trigger's service account. The service account must have
-     * permission to invoke Cloud Run services, the permission is
+     * 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`.
@@ -2211,8 +2213,8 @@ public Builder clearServiceAccountEmail() {
      *
      *
      * 
-     * Optional. The email of the trigger's service account. The service account must have
-     * permission to invoke Cloud Run services, the permission is
+     * 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`.
@@ -2239,7 +2241,8 @@ public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value)
      *
      *
      * 
-     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+     * them).
      * 
* * @@ -2256,7 +2259,8 @@ public int getRetryPolicyValue() { * * *
-     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+     * them).
      * 
* * @@ -2276,7 +2280,8 @@ public Builder setRetryPolicyValue(int value) { * * *
-     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+     * them).
      * 
* * @@ -2297,7 +2302,8 @@ public com.google.cloud.functions.v2.EventTrigger.RetryPolicy getRetryPolicy() { * * *
-     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+     * them).
      * 
* * @@ -2320,7 +2326,8 @@ public Builder setRetryPolicy(com.google.cloud.functions.v2.EventTrigger.RetryPo * * *
-     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+     * them).
      * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java index c7c5d1e51be5..443e4cd045d1 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/EventTriggerOrBuilder.java @@ -27,8 +27,8 @@ public interface EventTriggerOrBuilder * * *
-   * Output only. The resource name of the Eventarc trigger. The format of this field is
-   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * Output only. The resource name of the Eventarc trigger. The format of this
+   * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
    * 
* * @@ -42,8 +42,8 @@ public interface EventTriggerOrBuilder * * *
-   * Output only. The resource name of the Eventarc trigger. The format of this field is
-   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * Output only. The resource name of the Eventarc trigger. The format of this
+   * field is `projects/{project}/locations/{region}/triggers/{trigger}`.
    * 
* * @@ -209,8 +209,8 @@ public interface EventTriggerOrBuilder * * *
-   * Optional. The email of the trigger's service account. The service account must have
-   * permission to invoke Cloud Run services, the permission is
+   * 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`.
@@ -225,8 +225,8 @@ public interface EventTriggerOrBuilder
    *
    *
    * 
-   * Optional. The email of the trigger's service account. The service account must have
-   * permission to invoke Cloud Run services, the permission is
+   * 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`.
@@ -242,7 +242,8 @@ public interface EventTriggerOrBuilder
    *
    *
    * 
-   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+   * them).
    * 
* * @@ -256,7 +257,8 @@ public interface EventTriggerOrBuilder * * *
-   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying
+   * them).
    * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java index 311c8917e474..c76b47a059fa 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/Function.java @@ -44,6 +44,8 @@ private Function() { description_ = ""; state_ = 0; stateMessages_ = java.util.Collections.emptyList(); + kmsKeyName_ = ""; + url_ = ""; } @java.lang.Override @@ -367,7 +369,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-   * Describe whether the function is gen1 or gen2.
+   * Describe whether the function is 1st Gen or 2nd Gen.
    * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -382,7 +384,7 @@ public int getEnvironmentValue() { * * *
-   * Describe whether the function is gen1 or gen2.
+   * Describe whether the function is 1st Gen or 2nd Gen.
    * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -877,6 +879,114 @@ public com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBui return stateMessages_.get(index); } + public static final int KMS_KEY_NAME_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function resources.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function resources.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 14; + + @SuppressWarnings("serial") + private volatile java.lang.Object url_ = ""; + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -921,6 +1031,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.functions.v2.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { output.writeEnum(10, environment_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, url_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 25, kmsKeyName_); + } getUnknownFields().writeTo(output); } @@ -968,6 +1084,12 @@ public int getSerializedSize() { != com.google.cloud.functions.v2.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, environment_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, url_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(25, kmsKeyName_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1005,6 +1127,8 @@ public boolean equals(final java.lang.Object obj) { } if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (!getStateMessagesList().equals(other.getStateMessagesList())) return false; + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getUrl().equals(other.getUrl())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1048,6 +1172,10 @@ public int hashCode() { hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; hash = (53 * hash) + getStateMessagesList().hashCode(); } + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1240,6 +1368,8 @@ public Builder clear() { stateMessagesBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000200); + kmsKeyName_ = ""; + url_ = ""; return this; } @@ -1320,6 +1450,12 @@ private void buildPartial0(com.google.cloud.functions.v2.Function result) { result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.url_ = url_; + } } @java.lang.Override @@ -1424,6 +1560,16 @@ public Builder mergeFrom(com.google.cloud.functions.v2.Function other) { } } } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000400; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + bitField0_ |= 0x00000800; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1523,6 +1669,18 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 80 + case 114: + { + url_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000800; + break; + } // case 114 + case 202: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000400; + break; + } // case 202 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1658,7 +1816,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
-     * Describe whether the function is gen1 or gen2.
+     * Describe whether the function is 1st Gen or 2nd Gen.
      * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -1673,7 +1831,7 @@ public int getEnvironmentValue() { * * *
-     * Describe whether the function is gen1 or gen2.
+     * Describe whether the function is 1st Gen or 2nd Gen.
      * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -1691,7 +1849,7 @@ public Builder setEnvironmentValue(int value) { * * *
-     * Describe whether the function is gen1 or gen2.
+     * Describe whether the function is 1st Gen or 2nd Gen.
      * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -1708,7 +1866,7 @@ public com.google.cloud.functions.v2.Environment getEnvironment() { * * *
-     * Describe whether the function is gen1 or gen2.
+     * Describe whether the function is 1st Gen or 2nd Gen.
      * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -1729,7 +1887,7 @@ public Builder setEnvironment(com.google.cloud.functions.v2.Environment value) { * * *
-     * Describe whether the function is gen1 or gen2.
+     * Describe whether the function is 1st Gen or 2nd Gen.
      * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -3283,6 +3441,233 @@ public com.google.cloud.functions.v2.StateMessage.Builder addStateMessagesBuilde return stateMessagesBuilder_; } + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function resources.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function resources.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function resources.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function resources.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function resources.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for url. + */ + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + url_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUrl() { + url_ = getDefaultInstance().getUrl(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The deployed url for the function.
+     * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + url_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java index 93bffd4f89c5..c955249e1d76 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionOrBuilder.java @@ -54,7 +54,7 @@ public interface FunctionOrBuilder * * *
-   * Describe whether the function is gen1 or gen2.
+   * Describe whether the function is 1st Gen or 2nd Gen.
    * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -66,7 +66,7 @@ public interface FunctionOrBuilder * * *
-   * Describe whether the function is gen1 or gen2.
+   * Describe whether the function is 1st Gen or 2nd Gen.
    * 
* * .google.cloud.functions.v2.Environment environment = 10; @@ -400,4 +400,60 @@ java.lang.String getLabelsOrDefault( *
*/ com.google.cloud.functions.v2.StateMessageOrBuilder getStateMessagesOrBuilder(int index); + + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function resources.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function resources.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * 
+ * + * string kms_key_name = 25 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The url. + */ + java.lang.String getUrl(); + /** + * + * + *
+   * Output only. The deployed url for the function.
+   * 
+ * + * string url = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for url. + */ + com.google.protobuf.ByteString getUrlBytes(); } diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java index 2c0c1253b1a9..e8124f6d9e62 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/FunctionsProto.java @@ -166,243 +166,258 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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" + + "any.proto\032\033google/protobuf/empty.proto\032 " + + "google/protobuf/field_mask.proto\032\037google" + + "/protobuf/timestamp.proto\"\207\007\n\010Function\022\014" + + "\n\004name\030\001 \001(\t\022;\n\013environment\030\n \001(\0162&.goog" + + "le.cloud.functions.v2.Environment\022\023\n\013des" + + "cription\030\002 \001(\t\022<\n\014build_config\030\003 \001(\0132&.g" + + "oogle.cloud.functions.v2.BuildConfig\022@\n\016" + + "service_config\030\004 \001(\0132(.google.cloud.func" + + "tions.v2.ServiceConfig\022>\n\revent_trigger\030" + + "\005 \001(\0132\'.google.cloud.functions.v2.EventT" + + "rigger\022=\n\005state\030\006 \001(\0162).google.cloud.fun" + + "ctions.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.funct" + + "ions.v2.Function.LabelsEntry\022D\n\016state_me" + + "ssages\030\t \003(\0132\'.google.cloud.functions.v2" + + ".StateMessageB\003\340A\003\022<\n\014kms_key_name\030\031 \001(\t" + + "B&\372A#\n!cloudkms.googleapis.com/CryptoKey" + + "\022\020\n\003url\030\016 \001(\tB\003\340A\003\032-\n\013LabelsEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"`\n\005State\022\025\n\021ST" + + "ATE_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\007UNKNOW" + + "N\020\005:~\352A{\n&cloudfunctions.googleapis.com/" + + "Function\022\n\013worker_p" + + "ool\030\005 \001(\tB)\372A&\n$cloudbuild.googleapis.co" + + "m/WorkerPool\022_\n\025environment_variables\030\006 " + + "\003(\0132@.google.cloud.functions.v2.BuildCon" + + "fig.EnvironmentVariablesEntry\022S\n\017docker_" + + "registry\030\n \001(\01625.google.cloud.functions." + + "v2.BuildConfig.DockerRegistryB\003\340A\001\022J\n\021do" + + "cker_repository\030\007 \001(\tB/\372A,\n*artifactregi" + + "stry.googleapis.com/Repository\032;\n\031Enviro" + + "nmentVariablesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" + + "e\030\002 \001(\t:\0028\001\"`\n\016DockerRegistry\022\037\n\033DOCKER_" + + "REGISTRY_UNSPECIFIED\020\000\022\026\n\022CONTAINER_REGI" + + "STRY\020\001\022\025\n\021ARTIFACT_REGISTRY\020\002\"\252\n\n\rServic" + + "eConfig\0223\n\007service\030\001 \001(\tB\"\340A\003\372A\034\n\032run.go" + + "ogleapis.com/Service\022\027\n\017timeout_seconds\030" + + "\002 \001(\005\022\030\n\020available_memory\030\r \001(\t\022\025\n\ravail" + + "able_cpu\030\026 \001(\t\022a\n\025environment_variables\030" + + "\004 \003(\0132B.google.cloud.functions.v2.Servic" + + "eConfig.EnvironmentVariablesEntry\022\032\n\022max" + + "_instance_count\030\005 \001(\005\022\032\n\022min_instance_co" + + "unt\030\014 \001(\005\022>\n\rvpc_connector\030\006 \001(\tB\'\372A$\n\"v" + + "pcaccess.googleapis.com/Connector\022j\n\035vpc" + + "_connector_egress_settings\030\007 \001(\0162C.googl" + + "e.cloud.functions.v2.ServiceConfig.VpcCo" + + "nnectorEgressSettings\022R\n\020ingress_setting" + + "s\030\010 \001(\01628.google.cloud.functions.v2.Serv" + + "iceConfig.IngressSettings\022\020\n\003uri\030\t \001(\tB\003" + + "\340A\003\022\035\n\025service_account_email\030\n \001(\t\022&\n\036al" + + "l_traffic_on_latest_revision\030\020 \001(\010\022M\n\034se" + + "cret_environment_variables\030\021 \003(\0132\'.googl" + + "e.cloud.functions.v2.SecretEnvVar\022?\n\016sec" + + "ret_volumes\030\023 \003(\0132\'.google.cloud.functio" + + "ns.v2.SecretVolume\022\025\n\010revision\030\022 \001(\tB\003\340A" + + "\003\022(\n max_instance_request_concurrency\030\024 " + + "\001(\005\022N\n\016security_level\030\025 \001(\01626.google.clo" + + "ud.functions.v2.ServiceConfig.SecurityLe" + + "vel\032;\n\031EnvironmentVariablesEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u\n\032VpcConnector" + + "EgressSettings\022-\n)VPC_CONNECTOR_EGRESS_S" + + "ETTINGS_UNSPECIFIED\020\000\022\027\n\023PRIVATE_RANGES_" + + "ONLY\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n\017IngressSettin" + + "gs\022 \n\034INGRESS_SETTINGS_UNSPECIFIED\020\000\022\r\n\t" + + "ALLOW_ALL\020\001\022\027\n\023ALLOW_INTERNAL_ONLY\020\002\022\033\n\027" + + "ALLOW_INTERNAL_AND_GCLB\020\003\"W\n\rSecurityLev" + + "el\022\036\n\032SECURITY_LEVEL_UNSPECIFIED\020\000\022\021\n\rSE" + + "CURE_ALWAYS\020\001\022\023\n\017SECURE_OPTIONAL\020\002\"P\n\014Se" + + "cretEnvVar\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" + + "\014SecretVolume\022\022\n\nmount_path\030\001 \001(\t\022\022\n\npro" + + "ject_id\030\002 \001(\t\022\016\n\006secret\030\003 \001(\t\022G\n\010version" + + "s\030\004 \003(\01325.google.cloud.functions.v2.Secr" + + "etVolume.SecretVersion\032.\n\rSecretVersion\022" + + "\017\n\007version\030\001 \001(\t\022\014\n\004path\030\002 \001(\t\"\205\004\n\014Event" + + "Trigger\0228\n\007trigger\030\001 \001(\tB\'\340A\003\372A!\n\037eventa" + + "rc.googleapis.com/Trigger\022\026\n\016trigger_reg" + + "ion\030\002 \001(\t\022\027\n\nevent_type\030\003 \001(\tB\003\340A\002\022=\n\rev" + + "ent_filters\030\004 \003(\0132&.google.cloud.functio" + + "ns.v2.EventFilter\0229\n\014pubsub_topic\030\005 \001(\tB" + + "#\340A\001\372A\035\n\033pubsub.googleapis.com/Topic\022\"\n\025" + + "service_account_email\030\006 \001(\tB\003\340A\001\022N\n\014retr" + + "y_policy\030\007 \001(\01623.google.cloud.functions." + + "v2.EventTrigger.RetryPolicyB\003\340A\001\0228\n\007chan" + + "nel\030\010 \001(\tB\'\340A\001\372A!\n\037eventarc.googleapis.c" + + "om/Channel\"b\n\013RetryPolicy\022\034\n\030RETRY_POLIC" + + "Y_UNSPECIFIED\020\000\022\035\n\031RETRY_POLICY_DO_NOT_R" + + "ETRY\020\001\022\026\n\022RETRY_POLICY_RETRY\020\002\"P\n\013EventF" + + "ilter\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\022GetF" + + "unctionRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&cl" + + "oudfunctions.googleapis.com/Function\"\237\001\n" + + "\024ListFunctionsRequest\022>\n\006parent\030\001 \001(\tB.\340" + + "A\002\372A(\022&cloudfunctions.googleapis.com/Fun" + + "ction\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\025ListFunctionsResponse\0226\n\tfunctions\030\001 \003" + + "(\0132#.google.cloud.functions.v2.Function\022" + + "\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030" + + "\003 \003(\t\"\243\001\n\025CreateFunctionRequest\0229\n\006paren" + + "t\030\001 \001(\tB)\340A\002\372A#\n!locations.googleapis.co" + + "m/Location\022:\n\010function\030\002 \001(\0132#.google.cl" + + "oud.functions.v2.FunctionB\003\340A\002\022\023\n\013functi" + + "on_id\030\003 \001(\t\"\204\001\n\025UpdateFunctionRequest\022:\n" + + "\010function\030\001 \001(\0132#.google.cloud.functions" + + ".v2.FunctionB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032" + + ".google.protobuf.FieldMask\"U\n\025DeleteFunc" + "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\356\007\n\035com.google.clo" - + "ud.functions.v2B\016FunctionsProtoP\001Z;cloud" - + ".google.com/go/functions/apiv2/functions" - + "pb;functionspb\242\002\003GCF\352Ao\n*artifactregistr" - + "y.googleapis.com/Repository\022Aprojects/{p" - + "roject}/locations/{location}/repositorie" - + "s/{repository}\352AY\n\037cloudbuild.googleapis" - + ".com/Build\0226projects/{project}/locations" - + "/{location}/builds/{build}\352Ai\n$cloudbuil" - + "d.googleapis.com/WorkerPool\022Aprojects/{p" - + "roject}/locations/{location}/workerPools" - + "/{worker_pool}\352AX\n\032run.googleapis.com/Se" - + "rvice\022:projects/{project}/locations/{loc" - + "ation}/services/{service}\352Ad\n\"vpcaccess." - + "googleapis.com/Connector\022>projects/{proj" - + "ect}/locations/{location}/connectors/{co" - + "nnector}\352A]\n\037eventarc.googleapis.com/Tri" - + "gger\022:projects/{project}/locations/{loca" - + "tion}/triggers/{trigger}\352A]\n\037eventarc.go" - + "ogleapis.com/Channel\022:projects/{project}" - + "/locations/{location}/channels/{channel}" - + "\352A@\n\033pubsub.googleapis.com/Topic\022!projec" - + "ts/{project}/topics/{topic}\352Ax\n!cloudkms" - + ".googleapis.com/CryptoKey\022Sprojects/{pro" - + "ject}/locations/{location}/keyRings/{key" - + "_ring}/cryptoKeys/{crypto_key}b\006proto3" + + "functions.googleapis.com/Function\"\223\001\n\030Ge" + + "nerateUploadUrlRequest\0229\n\006parent\030\001 \001(\tB)" + + "\340A\002\372A#\n!locations.googleapis.com/Locatio" + + "n\022<\n\014kms_key_name\030\002 \001(\tB&\372A#\n!cloudkms.g" + + "oogleapis.com/CryptoKey\"q\n\031GenerateUploa" + + "dUrlResponse\022\022\n\nupload_url\030\001 \001(\t\022@\n\016stor" + + "age_source\030\002 \001(\0132(.google.cloud.function" + + "s.v2.StorageSource\"Z\n\032GenerateDownloadUr" + + "lRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&cloudfun" + + "ctions.googleapis.com/Function\"3\n\033Genera" + + "teDownloadUrlResponse\022\024\n\014download_url\030\001 " + + "\001(\t\"`\n\023ListRuntimesRequest\0229\n\006parent\030\001 \001" + + "(\tB)\340A\002\372A#\n!locations.googleapis.com/Loc" + + "ation\022\016\n\006filter\030\002 \001(\t\"\256\003\n\024ListRuntimesRe" + + "sponse\022I\n\010runtimes\030\001 \003(\01327.google.cloud." + + "functions.v2.ListRuntimesResponse.Runtim" + + "e\032\311\001\n\007Runtime\022\014\n\004name\030\001 \001(\t\022\024\n\014display_n" + + "ame\030\005 \001(\t\022K\n\005stage\030\002 \001(\0162<.google.cloud." + + "functions.v2.ListRuntimesResponse.Runtim" + + "eStage\022\020\n\010warnings\030\003 \003(\t\022;\n\013environment\030" + + "\004 \001(\0162&.google.cloud.functions.v2.Enviro" + + "nment\"\177\n\014RuntimeStage\022\035\n\031RUNTIME_STAGE_U" + + "NSPECIFIED\020\000\022\017\n\013DEVELOPMENT\020\001\022\t\n\005ALPHA\020\002" + + "\022\010\n\004BETA\020\003\022\006\n\002GA\020\004\022\016\n\nDEPRECATED\020\005\022\022\n\016DE" + + "COMMISSIONED\020\006\"\270\002\n\021OperationMetadata\022/\n\013" + + "create_time\030\001 \001(\0132\032.google.protobuf.Time" + + "stamp\022,\n\010end_time\030\002 \001(\0132\032.google.protobu" + + "f.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_reque" + + "sted\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t\022.\n\020reque" + + "st_resource\030\010 \001(\0132\024.google.protobuf.Any\022" + + "0\n\006stages\030\t \003(\0132 .google.cloud.functions" + + ".v2.Stage\"\304\003\n\005Stage\0223\n\004name\030\001 \001(\0162%.goog" + + "le.cloud.functions.v2.Stage.Name\022\017\n\007mess" + + "age\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_messag" + + "es\030\006 \003(\0132\'.google.cloud.functions.v2.Sta" + + "teMessage\"\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\007SE" + + "RVICE\020\003\022\013\n\007TRIGGER\020\004\022\024\n\020SERVICE_ROLLBACK" + + "\020\005\022\024\n\020TRIGGER_ROLLBACK\020\006\"N\n\005State\022\025\n\021STA" + + "TE_UNSPECIFIED\020\000\022\017\n\013NOT_STARTED\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\017FunctionService\022\237\001\n\013GetFu" + + "nction\022-.google.cloud.functions.v2.GetFu" + + "nctionRequest\032#.google.cloud.functions.v" + + "2.Function\"<\202\323\344\223\002/\022-/v2/{name=projects/*" + + "/locations/*/functions/*}\332A\004name\022\262\001\n\rLis" + + "tFunctions\022/.google.cloud.functions.v2.L" + + "istFunctionsRequest\0320.google.cloud.funct" + + "ions.v2.ListFunctionsResponse\">\202\323\344\223\002/\022-/" + + "v2/{parent=projects/*/locations/*}/funct" + + "ions\332A\006parent\022\225\002\n\016CreateFunction\0220.googl" + + "e.cloud.functions.v2.CreateFunctionReque" + + "st\032\035.google.longrunning.Operation\"\261\001\202\323\344\223" + + "\0029\"-/v2/{parent=projects/*/locations/*}/" + + "functions:\010function\332A\033parent,function,fu" + + "nction_id\312AQ\n\"google.cloud.functions.v2." + + "Function\022+google.cloud.functions.v2.Oper" + + "ationMetadata\022\227\002\n\016UpdateFunction\0220.googl" + + "e.cloud.functions.v2.UpdateFunctionReque" + + "st\032\035.google.longrunning.Operation\"\263\001\202\323\344\223" + + "\002B26/v2/{function.name=projects/*/locati" + + "ons/*/functions/*}:\010function\332A\024function," + + "update_mask\312AQ\n\"google.cloud.functions.v" + + "2.Function\022+google.cloud.functions.v2.Op" + + "erationMetadata\022\347\001\n\016DeleteFunction\0220.goo" + + "gle.cloud.functions.v2.DeleteFunctionReq" + + "uest\032\035.google.longrunning.Operation\"\203\001\202\323" + + "\344\223\002/*-/v2/{name=projects/*/locations/*/f" + + "unctions/*}\332A\004name\312AD\n\025google.protobuf.E" + + "mpty\022+google.cloud.functions.v2.Operatio" + + "nMetadata\022\312\001\n\021GenerateUploadUrl\0223.google" + + ".cloud.functions.v2.GenerateUploadUrlReq" + + "uest\0324.google.cloud.functions.v2.Generat" + + "eUploadUrlResponse\"J\202\323\344\223\002D\"?/v2/{parent=" + + "projects/*/locations/*}/functions:genera" + + "teUploadUrl:\001*\022\322\001\n\023GenerateDownloadUrl\0225" + + ".google.cloud.functions.v2.GenerateDownl" + + "oadUrlRequest\0326.google.cloud.functions.v" + + "2.GenerateDownloadUrlResponse\"L\202\323\344\223\002F\"A/" + + "v2/{name=projects/*/locations/*/function" + + "s/*}:generateDownloadUrl:\001*\022\256\001\n\014ListRunt" + + "imes\022..google.cloud.functions.v2.ListRun" + + "timesRequest\032/.google.cloud.functions.v2" + + ".ListRuntimesResponse\"=\202\323\344\223\002.\022,/v2/{pare" + + "nt=projects/*/locations/*}/runtimes\332A\006pa" + + "rent\032Q\312A\035cloudfunctions.googleapis.com\322A" + + ".https://www.googleapis.com/auth/cloud-p" + + "latformB\356\007\n\035com.google.cloud.functions.v" + + "2B\016FunctionsProtoP\001Z;cloud.google.com/go" + + "/functions/apiv2/functionspb;functionspb" + + "\242\002\003GCF\352Ao\n*artifactregistry.googleapis.c" + + "om/Repository\022Aprojects/{project}/locati" + + "ons/{location}/repositories/{repository}" + + "\352AY\n\037cloudbuild.googleapis.com/Build\0226pr" + + "ojects/{project}/locations/{location}/bu" + + "ilds/{build}\352Ai\n$cloudbuild.googleapis.c" + + "om/WorkerPool\022Aprojects/{project}/locati" + + "ons/{location}/workerPools/{worker_pool}" + + "\352AX\n\032run.googleapis.com/Service\022:project" + + "s/{project}/locations/{location}/service" + + "s/{service}\352Ad\n\"vpcaccess.googleapis.com" + + "/Connector\022>projects/{project}/locations" + + "/{location}/connectors/{connector}\352A]\n\037e" + + "ventarc.googleapis.com/Trigger\022:projects" + + "/{project}/locations/{location}/triggers" + + "/{trigger}\352A]\n\037eventarc.googleapis.com/C" + + "hannel\022:projects/{project}/locations/{lo" + + "cation}/channels/{channel}\352A@\n\033pubsub.go" + + "ogleapis.com/Topic\022!projects/{project}/t" + + "opics/{topic}\352Ax\n!cloudkms.googleapis.co" + + "m/CryptoKey\022Sprojects/{project}/location" + + "s/{location}/keyRings/{key_ring}/cryptoK" + + "eys/{crypto_key}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -414,6 +429,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); @@ -433,6 +449,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UpdateTime", "Labels", "StateMessages", + "KmsKeyName", + "Url", }); internal_static_google_cloud_functions_v2_Function_LabelsEntry_descriptor = internal_static_google_cloud_functions_v2_Function_descriptor.getNestedTypes().get(0); @@ -502,6 +520,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SourceProvenance", "WorkerPool", "EnvironmentVariables", + "DockerRegistry", "DockerRepository", }); internal_static_google_cloud_functions_v2_BuildConfig_EnvironmentVariablesEntry_descriptor = @@ -521,6 +540,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Service", "TimeoutSeconds", "AvailableMemory", + "AvailableCpu", "EnvironmentVariables", "MaxInstanceCount", "MinInstanceCount", @@ -533,6 +553,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SecretEnvironmentVariables", "SecretVolumes", "Revision", + "MaxInstanceRequestConcurrency", + "SecurityLevel", }); internal_static_google_cloud_functions_v2_ServiceConfig_EnvironmentVariablesEntry_descriptor = internal_static_google_cloud_functions_v2_ServiceConfig_descriptor.getNestedTypes().get(0); @@ -643,7 +665,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_functions_v2_GenerateUploadUrlRequest_descriptor, new java.lang.String[] { - "Parent", + "Parent", "KmsKeyName", }); internal_static_google_cloud_functions_v2_GenerateUploadUrlResponse_descriptor = getDescriptor().getMessageTypes().get(19); @@ -738,6 +760,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java index 86c2aadbc007..97ad32cbf1f7 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequest.java @@ -75,8 +75,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The name of function for which source code Google Cloud Storage signed
-   * URL should be generated.
+   * Required. The name of function for which source code Google Cloud Storage
+   * signed URL should be generated.
    * 
* * @@ -101,8 +101,8 @@ public java.lang.String getName() { * * *
-   * Required. The name of function for which source code Google Cloud Storage signed
-   * URL should be generated.
+   * Required. The name of function for which source code Google Cloud Storage
+   * signed URL should be generated.
    * 
* * @@ -472,8 +472,8 @@ public Builder mergeFrom( * * *
-     * Required. The name of function for which source code Google Cloud Storage signed
-     * URL should be generated.
+     * Required. The name of function for which source code Google Cloud Storage
+     * signed URL should be generated.
      * 
* * @@ -497,8 +497,8 @@ public java.lang.String getName() { * * *
-     * Required. The name of function for which source code Google Cloud Storage signed
-     * URL should be generated.
+     * Required. The name of function for which source code Google Cloud Storage
+     * signed URL should be generated.
      * 
* * @@ -522,8 +522,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The name of function for which source code Google Cloud Storage signed
-     * URL should be generated.
+     * Required. The name of function for which source code Google Cloud Storage
+     * signed URL should be generated.
      * 
* * @@ -546,8 +546,8 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The name of function for which source code Google Cloud Storage signed
-     * URL should be generated.
+     * Required. The name of function for which source code Google Cloud Storage
+     * signed URL should be generated.
      * 
* * @@ -566,8 +566,8 @@ public Builder clearName() { * * *
-     * Required. The name of function for which source code Google Cloud Storage signed
-     * URL should be generated.
+     * Required. The name of function for which source code Google Cloud Storage
+     * signed URL should be generated.
      * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java index 58c862458095..78311249cffa 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateDownloadUrlRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface GenerateDownloadUrlRequestOrBuilder * * *
-   * Required. The name of function for which source code Google Cloud Storage signed
-   * URL should be generated.
+   * Required. The name of function for which source code Google Cloud Storage
+   * signed URL should be generated.
    * 
* * @@ -42,8 +42,8 @@ public interface GenerateDownloadUrlRequestOrBuilder * * *
-   * Required. The name of function for which source code Google Cloud Storage signed
-   * URL should be generated.
+   * Required. The name of function for which source code Google Cloud Storage
+   * signed URL should be generated.
    * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java index 7979a58b1664..4859616dfa84 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequest.java @@ -39,6 +39,7 @@ private GenerateUploadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder< private GenerateUploadUrlRequest() { parent_ = ""; + kmsKeyName_ = ""; } @java.lang.Override @@ -75,8 +76,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The project and location in which the Google Cloud Storage signed URL
-   * should be generated, specified in the format `projects/*/locations/*`.
+   * Required. The project and location in which the Google Cloud Storage signed
+   * URL should be generated, specified in the format `projects/*/locations/*`.
    * 
* * @@ -101,8 +102,8 @@ public 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/*`.
+   * Required. The project and location in which the Google Cloud Storage signed
+   * URL should be generated, specified in the format `projects/*/locations/*`.
    * 
* * @@ -124,6 +125,81 @@ public com.google.protobuf.ByteString getParentBytes() { } } + public static final int KMS_KEY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function source code objects in intermediate Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to an intermediate Cloud Storage bucket. The source code is
+   * then copied to a versioned directory in the sources bucket in the consumer
+   * project during the function deployment.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * The Google Cloud Functions service account
+   * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+   * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+   * Key/KeyRing/Project/Organization (least access preferred).
+   * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function source code objects in intermediate Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to an intermediate Cloud Storage bucket. The source code is
+   * then copied to a versioned directory in the sources bucket in the consumer
+   * project during the function deployment.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * The Google Cloud Functions service account
+   * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+   * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+   * Key/KeyRing/Project/Organization (least access preferred).
+   * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -141,6 +217,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyName_); + } getUnknownFields().writeTo(output); } @@ -153,6 +232,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kmsKeyName_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -170,6 +252,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.functions.v2.GenerateUploadUrlRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -183,6 +266,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -324,6 +409,7 @@ public Builder clear() { super.clear(); bitField0_ = 0; parent_ = ""; + kmsKeyName_ = ""; return this; } @@ -363,6 +449,9 @@ private void buildPartial0(com.google.cloud.functions.v2.GenerateUploadUrlReques if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } } @java.lang.Override @@ -416,6 +505,11 @@ public Builder mergeFrom(com.google.cloud.functions.v2.GenerateUploadUrlRequest bitField0_ |= 0x00000001; onChanged(); } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000002; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -448,6 +542,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 10 + case 18: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -472,8 +572,8 @@ public Builder mergeFrom( * * *
-     * Required. The project and location in which the Google Cloud Storage signed URL
-     * should be generated, specified in the format `projects/*/locations/*`.
+     * Required. The project and location in which the Google Cloud Storage signed
+     * URL should be generated, specified in the format `projects/*/locations/*`.
      * 
* * @@ -497,8 +597,8 @@ public 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/*`.
+     * Required. The project and location in which the Google Cloud Storage signed
+     * URL should be generated, specified in the format `projects/*/locations/*`.
      * 
* * @@ -522,8 +622,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The project and location in which the Google Cloud Storage signed URL
-     * should be generated, specified in the format `projects/*/locations/*`.
+     * Required. The project and location in which the Google Cloud Storage signed
+     * URL should be generated, specified in the format `projects/*/locations/*`.
      * 
* * @@ -546,8 +646,8 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The project and location in which the Google Cloud Storage signed URL
-     * should be generated, specified in the format `projects/*/locations/*`.
+     * Required. The project and location in which the Google Cloud Storage signed
+     * URL should be generated, specified in the format `projects/*/locations/*`.
      * 
* * @@ -566,8 +666,8 @@ public Builder clearParent() { * * *
-     * Required. The project and location in which the Google Cloud Storage signed URL
-     * should be generated, specified in the format `projects/*/locations/*`.
+     * Required. The project and location in which the Google Cloud Storage signed
+     * URL should be generated, specified in the format `projects/*/locations/*`.
      * 
* * @@ -588,6 +688,172 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in intermediate Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to an intermediate Cloud Storage bucket. The source code is
+     * then copied to a versioned directory in the sources bucket in the consumer
+     * project during the function deployment.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * The Google Cloud Functions service account
+     * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+     * Key/KeyRing/Project/Organization (least access preferred).
+     * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in intermediate Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to an intermediate Cloud Storage bucket. The source code is
+     * then copied to a versioned directory in the sources bucket in the consumer
+     * project during the function deployment.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * The Google Cloud Functions service account
+     * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+     * Key/KeyRing/Project/Organization (least access preferred).
+     * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in intermediate Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to an intermediate Cloud Storage bucket. The source code is
+     * then copied to a versioned directory in the sources bucket in the consumer
+     * project during the function deployment.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * The Google Cloud Functions service account
+     * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+     * Key/KeyRing/Project/Organization (least access preferred).
+     * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in intermediate Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to an intermediate Cloud Storage bucket. The source code is
+     * then copied to a versioned directory in the sources bucket in the consumer
+     * project during the function deployment.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * The Google Cloud Functions service account
+     * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+     * Key/KeyRing/Project/Organization (least access preferred).
+     * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in intermediate Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to an intermediate Cloud Storage bucket. The source code is
+     * then copied to a versioned directory in the sources bucket in the consumer
+     * project during the function deployment.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+     * The Google Cloud Functions service account
+     * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+     * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+     * Key/KeyRing/Project/Organization (least access preferred).
+     * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java index d917cd037066..7f2ccf0f8701 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/GenerateUploadUrlRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface GenerateUploadUrlRequestOrBuilder * * *
-   * Required. The project and location in which the Google Cloud Storage signed URL
-   * should be generated, specified in the format `projects/*/locations/*`.
+   * Required. The project and location in which the Google Cloud Storage signed
+   * URL should be generated, specified in the format `projects/*/locations/*`.
    * 
* * @@ -42,8 +42,8 @@ public interface GenerateUploadUrlRequestOrBuilder * * *
-   * Required. The project and location in which the Google Cloud Storage signed URL
-   * should be generated, specified in the format `projects/*/locations/*`.
+   * Required. The project and location in which the Google Cloud Storage signed
+   * URL should be generated, specified in the format `projects/*/locations/*`.
    * 
* * @@ -53,4 +53,53 @@ public interface GenerateUploadUrlRequestOrBuilder * @return The bytes for parent. */ com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function source code objects in intermediate Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to an intermediate Cloud Storage bucket. The source code is
+   * then copied to a versioned directory in the sources bucket in the consumer
+   * project during the function deployment.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * The Google Cloud Functions service account
+   * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+   * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+   * Key/KeyRing/Project/Organization (least access preferred).
+   * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * Resource name of a KMS crypto key (managed by the user) used to
+   * encrypt/decrypt function source code objects in intermediate Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to an intermediate Cloud Storage bucket. The source code is
+   * then copied to a versioned directory in the sources bucket in the consumer
+   * project during the function deployment.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
+   * The Google Cloud Functions service account
+   * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
+   * (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
+   * Key/KeyRing/Project/Organization (least access preferred).
+   * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); } diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java index 4fe9eebb150d..a088473f6c46 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequest.java @@ -78,12 +78,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * 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.
+   * 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.
    * 
* * @@ -108,12 +108,12 @@ public 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.
+   * 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.
    * 
* * @@ -141,7 +141,10 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-   * Maximum number of functions to return per call.
+   * Maximum number of functions to return per call. The largest allowed
+   * page_size is 1,000, if the page_size is omitted or specified as greater
+   * than 1,000 then it will be replaced as 1,000. The size of the list
+   * response can be less than specified when used with filters.
    * 
* * int32 page_size = 2; @@ -759,12 +762,12 @@ public Builder mergeFrom( * * *
-     * 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.
+     * 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.
      * 
* * @@ -788,12 +791,12 @@ public 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.
+     * 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.
      * 
* * @@ -817,12 +820,12 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * 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.
+     * 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.
      * 
* * @@ -845,12 +848,12 @@ public Builder setParent(java.lang.String value) { * * *
-     * 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.
+     * 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.
      * 
* * @@ -869,12 +872,12 @@ public Builder clearParent() { * * *
-     * 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.
+     * 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.
      * 
* * @@ -900,7 +903,10 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
-     * Maximum number of functions to return per call.
+     * Maximum number of functions to return per call. The largest allowed
+     * page_size is 1,000, if the page_size is omitted or specified as greater
+     * than 1,000 then it will be replaced as 1,000. The size of the list
+     * response can be less than specified when used with filters.
      * 
* * int32 page_size = 2; @@ -915,7 +921,10 @@ public int getPageSize() { * * *
-     * Maximum number of functions to return per call.
+     * Maximum number of functions to return per call. The largest allowed
+     * page_size is 1,000, if the page_size is omitted or specified as greater
+     * than 1,000 then it will be replaced as 1,000. The size of the list
+     * response can be less than specified when used with filters.
      * 
* * int32 page_size = 2; @@ -934,7 +943,10 @@ public Builder setPageSize(int value) { * * *
-     * Maximum number of functions to return per call.
+     * Maximum number of functions to return per call. The largest allowed
+     * page_size is 1,000, if the page_size is omitted or specified as greater
+     * than 1,000 then it will be replaced as 1,000. The size of the list
+     * response can be less than specified when used with filters.
      * 
* * int32 page_size = 2; diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java index 0e2d156292b9..75e329eae331 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListFunctionsRequestOrBuilder.java @@ -27,12 +27,12 @@ public interface ListFunctionsRequestOrBuilder * * *
-   * 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.
+   * 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.
    * 
* * @@ -46,12 +46,12 @@ public interface ListFunctionsRequestOrBuilder * * *
-   * 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.
+   * 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.
    * 
* * @@ -66,7 +66,10 @@ public interface ListFunctionsRequestOrBuilder * * *
-   * Maximum number of functions to return per call.
+   * Maximum number of functions to return per call. The largest allowed
+   * page_size is 1,000, if the page_size is omitted or specified as greater
+   * than 1,000 then it will be replaced as 1,000. The size of the list
+   * response can be less than specified when used with filters.
    * 
* * int32 page_size = 2; diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java index dae7456faf90..acde40edb909 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequest.java @@ -76,8 +76,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The project and location from which the runtimes should be listed,
-   * specified in the format `projects/*/locations/*`
+   * Required. The project and location from which the runtimes should be
+   * listed, specified in the format `projects/*/locations/*`
    * 
* * @@ -102,8 +102,8 @@ public java.lang.String getParent() { * * *
-   * Required. The project and location from which the runtimes should be listed,
-   * specified in the format `projects/*/locations/*`
+   * Required. The project and location from which the runtimes should be
+   * listed, specified in the format `projects/*/locations/*`
    * 
* * @@ -549,8 +549,8 @@ public Builder mergeFrom( * * *
-     * Required. The project and location from which the runtimes should be listed,
-     * specified in the format `projects/*/locations/*`
+     * Required. The project and location from which the runtimes should be
+     * listed, specified in the format `projects/*/locations/*`
      * 
* * @@ -574,8 +574,8 @@ public java.lang.String getParent() { * * *
-     * Required. The project and location from which the runtimes should be listed,
-     * specified in the format `projects/*/locations/*`
+     * Required. The project and location from which the runtimes should be
+     * listed, specified in the format `projects/*/locations/*`
      * 
* * @@ -599,8 +599,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
-     * Required. The project and location from which the runtimes should be listed,
-     * specified in the format `projects/*/locations/*`
+     * Required. The project and location from which the runtimes should be
+     * listed, specified in the format `projects/*/locations/*`
      * 
* * @@ -623,8 +623,8 @@ public Builder setParent(java.lang.String value) { * * *
-     * Required. The project and location from which the runtimes should be listed,
-     * specified in the format `projects/*/locations/*`
+     * Required. The project and location from which the runtimes should be
+     * listed, specified in the format `projects/*/locations/*`
      * 
* * @@ -643,8 +643,8 @@ public Builder clearParent() { * * *
-     * Required. The project and location from which the runtimes should be listed,
-     * specified in the format `projects/*/locations/*`
+     * Required. The project and location from which the runtimes should be
+     * listed, specified in the format `projects/*/locations/*`
      * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java index 77c9fd7d8963..c73335d1347a 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ListRuntimesRequestOrBuilder.java @@ -27,8 +27,8 @@ public interface ListRuntimesRequestOrBuilder * * *
-   * Required. The project and location from which the runtimes should be listed,
-   * specified in the format `projects/*/locations/*`
+   * Required. The project and location from which the runtimes should be
+   * listed, specified in the format `projects/*/locations/*`
    * 
* * @@ -42,8 +42,8 @@ public interface ListRuntimesRequestOrBuilder * * *
-   * Required. The project and location from which the runtimes should be listed,
-   * specified in the format `projects/*/locations/*`
+   * Required. The project and location from which the runtimes should be
+   * listed, specified in the format `projects/*/locations/*`
    * 
* * diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java index 17228def5865..0af0c8d646e1 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadata.java @@ -324,8 +324,9 @@ public 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`.
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
    * 
* * bool cancel_requested = 6; @@ -1798,8 +1799,9 @@ public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { *
      * 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`.
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
      * 
* * bool cancel_requested = 6; @@ -1816,8 +1818,9 @@ public boolean getCancelRequested() { *
      * 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`.
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
      * 
* * bool cancel_requested = 6; @@ -1838,8 +1841,9 @@ public Builder setCancelRequested(boolean value) { *
      * 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`.
+     * have [Operation.error][] value with a
+     * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+     * `Code.CANCELLED`.
      * 
* * bool cancel_requested = 6; diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java index 0eb1ed752bbc..55dbcc653b87 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/OperationMetadataOrBuilder.java @@ -174,8 +174,9 @@ public interface OperationMetadataOrBuilder *
    * 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`.
+   * have [Operation.error][] value with a
+   * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
+   * `Code.CANCELLED`.
    * 
* * bool cancel_requested = 6; diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java index 1d6a63e6576f..211158b43716 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfig.java @@ -24,6 +24,7 @@ *
  * Describes the Service being deployed.
  * Currently Supported : Cloud Run (fully managed).
+ * Next tag: 23
  * 
* * Protobuf type {@code google.cloud.functions.v2.ServiceConfig} @@ -41,6 +42,7 @@ private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) private ServiceConfig() { service_ = ""; availableMemory_ = ""; + availableCpu_ = ""; vpcConnector_ = ""; vpcConnectorEgressSettings_ = 0; ingressSettings_ = 0; @@ -49,6 +51,7 @@ private ServiceConfig() { secretEnvironmentVariables_ = java.util.Collections.emptyList(); secretVolumes_ = java.util.Collections.emptyList(); revision_ = ""; + securityLevel_ = 0; } @java.lang.Override @@ -435,6 +438,174 @@ private IngressSettings(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.ServiceConfig.IngressSettings) } + /** + * + * + *
+   * Available security level settings.
+   * This enforces security protocol on function URL.
+   * Security level is only ocnfigurable for 1st Gen functions, If unspecified,
+   * SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2.ServiceConfig.SecurityLevel} + */ + public enum SecurityLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * SECURITY_LEVEL_UNSPECIFIED = 0; + */ + SECURITY_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+     * Requests for a URL that match this handler that do not use HTTPS are
+     * automatically redirected to the HTTPS URL with the same path. Query
+     * parameters are reserved for the redirect.
+     * 
+ * + * SECURE_ALWAYS = 1; + */ + SECURE_ALWAYS(1), + /** + * + * + *
+     * Both HTTP and HTTPS requests with URLs that match the handler succeed
+     * without redirects. The application can examine the request to determine
+     * which protocol was used and respond accordingly.
+     * 
+ * + * SECURE_OPTIONAL = 2; + */ + SECURE_OPTIONAL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * SECURITY_LEVEL_UNSPECIFIED = 0; + */ + public static final int SECURITY_LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Requests for a URL that match this handler that do not use HTTPS are
+     * automatically redirected to the HTTPS URL with the same path. Query
+     * parameters are reserved for the redirect.
+     * 
+ * + * SECURE_ALWAYS = 1; + */ + public static final int SECURE_ALWAYS_VALUE = 1; + /** + * + * + *
+     * Both HTTP and HTTPS requests with URLs that match the handler succeed
+     * without redirects. The application can examine the request to determine
+     * which protocol was used and respond accordingly.
+     * 
+ * + * SECURE_OPTIONAL = 2; + */ + public static final int SECURE_OPTIONAL_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 SecurityLevel 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 SecurityLevel forNumber(int value) { + switch (value) { + case 0: + return SECURITY_LEVEL_UNSPECIFIED; + case 1: + return SECURE_ALWAYS; + case 2: + return SECURE_OPTIONAL; + 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 SecurityLevel findValueByNumber(int number) { + return SecurityLevel.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(2); + } + + private static final SecurityLevel[] VALUES = values(); + + public static SecurityLevel 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 SecurityLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2.ServiceConfig.SecurityLevel) + } + public static final int SERVICE_FIELD_NUMBER = 1; @SuppressWarnings("serial") @@ -575,6 +746,65 @@ public com.google.protobuf.ByteString getAvailableMemoryBytes() { } } + public static final int AVAILABLE_CPU_FIELD_NUMBER = 22; + + @SuppressWarnings("serial") + private volatile java.lang.Object availableCpu_ = ""; + /** + * + * + *
+   * The number of CPUs used in a single container instance.
+   * Default value is calculated from available memory.
+   * Supports the same values as Cloud Run, see
+   * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+   * Example: "1" indicates 1 vCPU
+   * 
+ * + * string available_cpu = 22; + * + * @return The availableCpu. + */ + @java.lang.Override + public java.lang.String getAvailableCpu() { + java.lang.Object ref = availableCpu_; + 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(); + availableCpu_ = s; + return s; + } + } + /** + * + * + *
+   * The number of CPUs used in a single container instance.
+   * Default value is calculated from available memory.
+   * Supports the same values as Cloud Run, see
+   * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+   * Example: "1" indicates 1 vCPU
+   * 
+ * + * string available_cpu = 22; + * + * @return The bytes for availableCpu. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvailableCpuBytes() { + java.lang.Object ref = availableCpu_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableCpu_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 4; private static final class EnvironmentVariablesDefaultEntryHolder { @@ -1196,6 +1426,68 @@ public com.google.protobuf.ByteString getRevisionBytes() { } } + public static final int MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER = 20; + private int maxInstanceRequestConcurrency_ = 0; + /** + * + * + *
+   * Sets the maximum number of concurrent requests that each instance can
+   * receive. Defaults to 1.
+   * 
+ * + * int32 max_instance_request_concurrency = 20; + * + * @return The maxInstanceRequestConcurrency. + */ + @java.lang.Override + public int getMaxInstanceRequestConcurrency() { + return maxInstanceRequestConcurrency_; + } + + public static final int SECURITY_LEVEL_FIELD_NUMBER = 21; + private int securityLevel_ = 0; + /** + * + * + *
+   * Security level configure whether the function only accepts https.
+   * This configuration is only applicable to 1st Gen functions with Http
+   * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+   * functions are https ONLY.
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return The enum numeric value on the wire for securityLevel. + */ + @java.lang.Override + public int getSecurityLevelValue() { + return securityLevel_; + } + /** + * + * + *
+   * Security level configure whether the function only accepts https.
+   * This configuration is only applicable to 1st Gen functions with Http
+   * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+   * functions are https ONLY.
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return The securityLevel. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig.SecurityLevel getSecurityLevel() { + com.google.cloud.functions.v2.ServiceConfig.SecurityLevel result = + com.google.cloud.functions.v2.ServiceConfig.SecurityLevel.forNumber(securityLevel_); + return result == null + ? com.google.cloud.functions.v2.ServiceConfig.SecurityLevel.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1262,6 +1554,17 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < secretVolumes_.size(); i++) { output.writeMessage(19, secretVolumes_.get(i)); } + if (maxInstanceRequestConcurrency_ != 0) { + output.writeInt32(20, maxInstanceRequestConcurrency_); + } + if (securityLevel_ + != com.google.cloud.functions.v2.ServiceConfig.SecurityLevel.SECURITY_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(21, securityLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableCpu_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, availableCpu_); + } getUnknownFields().writeTo(output); } @@ -1331,6 +1634,19 @@ public int getSerializedSize() { for (int i = 0; i < secretVolumes_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, secretVolumes_.get(i)); } + if (maxInstanceRequestConcurrency_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 20, maxInstanceRequestConcurrency_); + } + if (securityLevel_ + != com.google.cloud.functions.v2.ServiceConfig.SecurityLevel.SECURITY_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(21, securityLevel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableCpu_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, availableCpu_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1350,6 +1666,7 @@ public boolean equals(final java.lang.Object obj) { if (!getService().equals(other.getService())) return false; if (getTimeoutSeconds() != other.getTimeoutSeconds()) return false; if (!getAvailableMemory().equals(other.getAvailableMemory())) return false; + if (!getAvailableCpu().equals(other.getAvailableCpu())) return false; if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) return false; if (getMaxInstanceCount() != other.getMaxInstanceCount()) return false; @@ -1364,6 +1681,9 @@ public boolean equals(final java.lang.Object obj) { return false; if (!getSecretVolumesList().equals(other.getSecretVolumesList())) return false; if (!getRevision().equals(other.getRevision())) return false; + if (getMaxInstanceRequestConcurrency() != other.getMaxInstanceRequestConcurrency()) + return false; + if (securityLevel_ != other.securityLevel_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1381,6 +1701,8 @@ public int hashCode() { hash = (53 * hash) + getTimeoutSeconds(); hash = (37 * hash) + AVAILABLE_MEMORY_FIELD_NUMBER; hash = (53 * hash) + getAvailableMemory().hashCode(); + hash = (37 * hash) + AVAILABLE_CPU_FIELD_NUMBER; + hash = (53 * hash) + getAvailableCpu().hashCode(); if (!internalGetEnvironmentVariables().getMap().isEmpty()) { hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); @@ -1411,6 +1733,10 @@ public int hashCode() { } hash = (37 * hash) + REVISION_FIELD_NUMBER; hash = (53 * hash) + getRevision().hashCode(); + hash = (37 * hash) + MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER; + hash = (53 * hash) + getMaxInstanceRequestConcurrency(); + hash = (37 * hash) + SECURITY_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + securityLevel_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -1517,6 +1843,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
    * Describes the Service being deployed.
    * Currently Supported : Cloud Run (fully managed).
+   * Next tag: 23
    * 
* * Protobuf type {@code google.cloud.functions.v2.ServiceConfig} @@ -1574,6 +1901,7 @@ public Builder clear() { service_ = ""; timeoutSeconds_ = 0; availableMemory_ = ""; + availableCpu_ = ""; internalGetMutableEnvironmentVariables().clear(); maxInstanceCount_ = 0; minInstanceCount_ = 0; @@ -1589,15 +1917,17 @@ public Builder clear() { secretEnvironmentVariables_ = null; secretEnvironmentVariablesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); if (secretVolumesBuilder_ == null) { secretVolumes_ = java.util.Collections.emptyList(); } else { secretVolumes_ = null; secretVolumesBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); revision_ = ""; + maxInstanceRequestConcurrency_ = 0; + securityLevel_ = 0; return this; } @@ -1635,19 +1965,19 @@ public com.google.cloud.functions.v2.ServiceConfig buildPartial() { private void buildPartialRepeatedFields(com.google.cloud.functions.v2.ServiceConfig result) { if (secretEnvironmentVariablesBuilder_ == null) { - if (((bitField0_ & 0x00001000) != 0)) { + if (((bitField0_ & 0x00002000) != 0)) { secretEnvironmentVariables_ = java.util.Collections.unmodifiableList(secretEnvironmentVariables_); - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); } result.secretEnvironmentVariables_ = secretEnvironmentVariables_; } else { result.secretEnvironmentVariables_ = secretEnvironmentVariablesBuilder_.build(); } if (secretVolumesBuilder_ == null) { - if (((bitField0_ & 0x00002000) != 0)) { + if (((bitField0_ & 0x00004000) != 0)) { secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); } result.secretVolumes_ = secretVolumes_; } else { @@ -1667,36 +1997,45 @@ private void buildPartial0(com.google.cloud.functions.v2.ServiceConfig result) { result.availableMemory_ = availableMemory_; } if (((from_bitField0_ & 0x00000008) != 0)) { + result.availableCpu_ = availableCpu_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { result.environmentVariables_ = internalGetEnvironmentVariables(); result.environmentVariables_.makeImmutable(); } - if (((from_bitField0_ & 0x00000010) != 0)) { + if (((from_bitField0_ & 0x00000020) != 0)) { result.maxInstanceCount_ = maxInstanceCount_; } - if (((from_bitField0_ & 0x00000020) != 0)) { + if (((from_bitField0_ & 0x00000040) != 0)) { result.minInstanceCount_ = minInstanceCount_; } - if (((from_bitField0_ & 0x00000040) != 0)) { + if (((from_bitField0_ & 0x00000080) != 0)) { result.vpcConnector_ = vpcConnector_; } - if (((from_bitField0_ & 0x00000080) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.vpcConnectorEgressSettings_ = vpcConnectorEgressSettings_; } - if (((from_bitField0_ & 0x00000100) != 0)) { + if (((from_bitField0_ & 0x00000200) != 0)) { result.ingressSettings_ = ingressSettings_; } - if (((from_bitField0_ & 0x00000200) != 0)) { + if (((from_bitField0_ & 0x00000400) != 0)) { result.uri_ = uri_; } - if (((from_bitField0_ & 0x00000400) != 0)) { + if (((from_bitField0_ & 0x00000800) != 0)) { result.serviceAccountEmail_ = serviceAccountEmail_; } - if (((from_bitField0_ & 0x00000800) != 0)) { + if (((from_bitField0_ & 0x00001000) != 0)) { result.allTrafficOnLatestRevision_ = allTrafficOnLatestRevision_; } - if (((from_bitField0_ & 0x00004000) != 0)) { + if (((from_bitField0_ & 0x00008000) != 0)) { result.revision_ = revision_; } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.maxInstanceRequestConcurrency_ = maxInstanceRequestConcurrency_; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.securityLevel_ = securityLevel_; + } } @java.lang.Override @@ -1757,8 +2096,13 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { bitField0_ |= 0x00000004; onChanged(); } + if (!other.getAvailableCpu().isEmpty()) { + availableCpu_ = other.availableCpu_; + bitField0_ |= 0x00000008; + onChanged(); + } internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; if (other.getMaxInstanceCount() != 0) { setMaxInstanceCount(other.getMaxInstanceCount()); } @@ -1767,7 +2111,7 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { } if (!other.getVpcConnector().isEmpty()) { vpcConnector_ = other.vpcConnector_; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } if (other.vpcConnectorEgressSettings_ != 0) { @@ -1778,12 +2122,12 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { } if (!other.getUri().isEmpty()) { uri_ = other.uri_; - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); } if (!other.getServiceAccountEmail().isEmpty()) { serviceAccountEmail_ = other.serviceAccountEmail_; - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); } if (other.getAllTrafficOnLatestRevision() != false) { @@ -1793,7 +2137,7 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { if (!other.secretEnvironmentVariables_.isEmpty()) { if (secretEnvironmentVariables_.isEmpty()) { secretEnvironmentVariables_ = other.secretEnvironmentVariables_; - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); } else { ensureSecretEnvironmentVariablesIsMutable(); secretEnvironmentVariables_.addAll(other.secretEnvironmentVariables_); @@ -1806,7 +2150,7 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { secretEnvironmentVariablesBuilder_.dispose(); secretEnvironmentVariablesBuilder_ = null; secretEnvironmentVariables_ = other.secretEnvironmentVariables_; - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); secretEnvironmentVariablesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSecretEnvironmentVariablesFieldBuilder() @@ -1820,7 +2164,7 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { if (!other.secretVolumes_.isEmpty()) { if (secretVolumes_.isEmpty()) { secretVolumes_ = other.secretVolumes_; - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); } else { ensureSecretVolumesIsMutable(); secretVolumes_.addAll(other.secretVolumes_); @@ -1833,7 +2177,7 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { secretVolumesBuilder_.dispose(); secretVolumesBuilder_ = null; secretVolumes_ = other.secretVolumes_; - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); secretVolumesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSecretVolumesFieldBuilder() @@ -1845,9 +2189,15 @@ public Builder mergeFrom(com.google.cloud.functions.v2.ServiceConfig other) { } if (!other.getRevision().isEmpty()) { revision_ = other.revision_; - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); } + if (other.getMaxInstanceRequestConcurrency() != 0) { + setMaxInstanceRequestConcurrency(other.getMaxInstanceRequestConcurrency()); + } + if (other.securityLevel_ != 0) { + setSecurityLevelValue(other.getSecurityLevelValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -1896,49 +2246,49 @@ public Builder mergeFrom( internalGetMutableEnvironmentVariables() .getMutableMap() .put(environmentVariables__.getKey(), environmentVariables__.getValue()); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; break; } // case 34 case 40: { maxInstanceCount_ = input.readInt32(); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; break; } // case 40 case 50: { vpcConnector_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 50 case 56: { vpcConnectorEgressSettings_ = input.readEnum(); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 56 case 64: { ingressSettings_ = input.readEnum(); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; break; } // case 64 case 74: { uri_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; break; } // case 74 case 82: { serviceAccountEmail_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; break; } // case 82 case 96: { minInstanceCount_ = input.readInt32(); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; break; } // case 96 case 106: @@ -1950,7 +2300,7 @@ public Builder mergeFrom( case 128: { allTrafficOnLatestRevision_ = input.readBool(); - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; break; } // case 128 case 138: @@ -1969,7 +2319,7 @@ public Builder mergeFrom( case 146: { revision_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; break; } // case 146 case 154: @@ -1985,6 +2335,24 @@ public Builder mergeFrom( } break; } // case 154 + case 160: + { + maxInstanceRequestConcurrency_ = input.readInt32(); + bitField0_ |= 0x00010000; + break; + } // case 160 + case 168: + { + securityLevel_ = input.readEnum(); + bitField0_ |= 0x00020000; + break; + } // case 168 + case 178: + { + availableCpu_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 178 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -2320,6 +2688,132 @@ public Builder setAvailableMemoryBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object availableCpu_ = ""; + /** + * + * + *
+     * The number of CPUs used in a single container instance.
+     * Default value is calculated from available memory.
+     * Supports the same values as Cloud Run, see
+     * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+     * Example: "1" indicates 1 vCPU
+     * 
+ * + * string available_cpu = 22; + * + * @return The availableCpu. + */ + public java.lang.String getAvailableCpu() { + java.lang.Object ref = availableCpu_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availableCpu_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The number of CPUs used in a single container instance.
+     * Default value is calculated from available memory.
+     * Supports the same values as Cloud Run, see
+     * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+     * Example: "1" indicates 1 vCPU
+     * 
+ * + * string available_cpu = 22; + * + * @return The bytes for availableCpu. + */ + public com.google.protobuf.ByteString getAvailableCpuBytes() { + java.lang.Object ref = availableCpu_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableCpu_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The number of CPUs used in a single container instance.
+     * Default value is calculated from available memory.
+     * Supports the same values as Cloud Run, see
+     * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+     * Example: "1" indicates 1 vCPU
+     * 
+ * + * string available_cpu = 22; + * + * @param value The availableCpu to set. + * @return This builder for chaining. + */ + public Builder setAvailableCpu(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + availableCpu_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * The number of CPUs used in a single container instance.
+     * Default value is calculated from available memory.
+     * Supports the same values as Cloud Run, see
+     * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+     * Example: "1" indicates 1 vCPU
+     * 
+ * + * string available_cpu = 22; + * + * @return This builder for chaining. + */ + public Builder clearAvailableCpu() { + availableCpu_ = getDefaultInstance().getAvailableCpu(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * The number of CPUs used in a single container instance.
+     * Default value is calculated from available memory.
+     * Supports the same values as Cloud Run, see
+     * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+     * Example: "1" indicates 1 vCPU
+     * 
+ * + * string available_cpu = 22; + * + * @param value The bytes for availableCpu to set. + * @return This builder for chaining. + */ + public Builder setAvailableCpuBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + availableCpu_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + private com.google.protobuf.MapField environmentVariables_; private com.google.protobuf.MapField @@ -2341,7 +2835,7 @@ public Builder setAvailableMemoryBytes(com.google.protobuf.ByteString value) { if (!environmentVariables_.isMutable()) { environmentVariables_ = environmentVariables_.copy(); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; onChanged(); return environmentVariables_; } @@ -2428,7 +2922,7 @@ public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { } public Builder clearEnvironmentVariables() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000010); internalGetMutableEnvironmentVariables().getMutableMap().clear(); return this; } @@ -2451,7 +2945,7 @@ public Builder removeEnvironmentVariables(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableEnvironmentVariables() { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; return internalGetMutableEnvironmentVariables().getMutableMap(); } /** @@ -2471,7 +2965,7 @@ public Builder putEnvironmentVariables(java.lang.String key, java.lang.String va throw new NullPointerException("map value"); } internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; return this; } /** @@ -2486,7 +2980,7 @@ public Builder putEnvironmentVariables(java.lang.String key, java.lang.String va public Builder putAllEnvironmentVariables( java.util.Map values) { internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000010; return this; } @@ -2539,7 +3033,7 @@ public int getMaxInstanceCount() { public Builder setMaxInstanceCount(int value) { maxInstanceCount_ = value; - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -2564,7 +3058,7 @@ public Builder setMaxInstanceCount(int value) { * @return This builder for chaining. */ public Builder clearMaxInstanceCount() { - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000020); maxInstanceCount_ = 0; onChanged(); return this; @@ -2615,7 +3109,7 @@ public int getMinInstanceCount() { public Builder setMinInstanceCount(int value) { minInstanceCount_ = value; - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2638,7 +3132,7 @@ public Builder setMinInstanceCount(int value) { * @return This builder for chaining. */ public Builder clearMinInstanceCount() { - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); minInstanceCount_ = 0; onChanged(); return this; @@ -2709,7 +3203,7 @@ public Builder setVpcConnector(java.lang.String value) { throw new NullPointerException(); } vpcConnector_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2727,7 +3221,7 @@ public Builder setVpcConnector(java.lang.String value) { */ public Builder clearVpcConnector() { vpcConnector_ = getDefaultInstance().getVpcConnector(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } @@ -2750,7 +3244,7 @@ public Builder setVpcConnectorBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); vpcConnector_ = value; - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2791,7 +3285,7 @@ public int getVpcConnectorEgressSettingsValue() { */ public Builder setVpcConnectorEgressSettingsValue(int value) { vpcConnectorEgressSettings_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2839,7 +3333,7 @@ public Builder setVpcConnectorEgressSettings( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; vpcConnectorEgressSettings_ = value.getNumber(); onChanged(); return this; @@ -2859,7 +3353,7 @@ public Builder setVpcConnectorEgressSettings( * @return This builder for chaining. */ public Builder clearVpcConnectorEgressSettings() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); vpcConnectorEgressSettings_ = 0; onChanged(); return this; @@ -2897,7 +3391,7 @@ public int getIngressSettingsValue() { */ public Builder setIngressSettingsValue(int value) { ingressSettings_ = value; - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; onChanged(); return this; } @@ -2939,7 +3433,7 @@ public Builder setIngressSettings( if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000200; ingressSettings_ = value.getNumber(); onChanged(); return this; @@ -2957,7 +3451,7 @@ public Builder setIngressSettings( * @return This builder for chaining. */ public Builder clearIngressSettings() { - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000200); ingressSettings_ = 0; onChanged(); return this; @@ -3025,7 +3519,7 @@ public Builder setUri(java.lang.String value) { throw new NullPointerException(); } uri_ = value; - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -3042,7 +3536,7 @@ public Builder setUri(java.lang.String value) { */ public Builder clearUri() { uri_ = getDefaultInstance().getUri(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000400); onChanged(); return this; } @@ -3064,7 +3558,7 @@ public Builder setUriBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); uri_ = value; - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000400; onChanged(); return this; } @@ -3134,7 +3628,7 @@ public Builder setServiceAccountEmail(java.lang.String value) { throw new NullPointerException(); } serviceAccountEmail_ = value; - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -3152,7 +3646,7 @@ public Builder setServiceAccountEmail(java.lang.String value) { */ public Builder clearServiceAccountEmail() { serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000800); onChanged(); return this; } @@ -3175,7 +3669,7 @@ public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) } checkByteStringIsUtf8(value); serviceAccountEmail_ = value; - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000800; onChanged(); return this; } @@ -3219,7 +3713,7 @@ public boolean getAllTrafficOnLatestRevision() { public Builder setAllTrafficOnLatestRevision(boolean value) { allTrafficOnLatestRevision_ = value; - bitField0_ |= 0x00000800; + bitField0_ |= 0x00001000; onChanged(); return this; } @@ -3239,7 +3733,7 @@ public Builder setAllTrafficOnLatestRevision(boolean value) { * @return This builder for chaining. */ public Builder clearAllTrafficOnLatestRevision() { - bitField0_ = (bitField0_ & ~0x00000800); + bitField0_ = (bitField0_ & ~0x00001000); allTrafficOnLatestRevision_ = false; onChanged(); return this; @@ -3249,11 +3743,11 @@ public Builder clearAllTrafficOnLatestRevision() { java.util.Collections.emptyList(); private void ensureSecretEnvironmentVariablesIsMutable() { - if (!((bitField0_ & 0x00001000) != 0)) { + if (!((bitField0_ & 0x00002000) != 0)) { secretEnvironmentVariables_ = new java.util.ArrayList( secretEnvironmentVariables_); - bitField0_ |= 0x00001000; + bitField0_ |= 0x00002000; } } @@ -3483,7 +3977,7 @@ public Builder addAllSecretEnvironmentVariables( public Builder clearSecretEnvironmentVariables() { if (secretEnvironmentVariablesBuilder_ == null) { secretEnvironmentVariables_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); } else { secretEnvironmentVariablesBuilder_.clear(); @@ -3617,7 +4111,7 @@ public com.google.cloud.functions.v2.SecretEnvVar.Builder addSecretEnvironmentVa com.google.cloud.functions.v2.SecretEnvVar.Builder, com.google.cloud.functions.v2.SecretEnvVarOrBuilder>( secretEnvironmentVariables_, - ((bitField0_ & 0x00001000) != 0), + ((bitField0_ & 0x00002000) != 0), getParentForChildren(), isClean()); secretEnvironmentVariables_ = null; @@ -3629,10 +4123,10 @@ public com.google.cloud.functions.v2.SecretEnvVar.Builder addSecretEnvironmentVa java.util.Collections.emptyList(); private void ensureSecretVolumesIsMutable() { - if (!((bitField0_ & 0x00002000) != 0)) { + if (!((bitField0_ & 0x00004000) != 0)) { secretVolumes_ = new java.util.ArrayList(secretVolumes_); - bitField0_ |= 0x00002000; + bitField0_ |= 0x00004000; } } @@ -3848,7 +4342,7 @@ public Builder addAllSecretVolumes( public Builder clearSecretVolumes() { if (secretVolumesBuilder_ == null) { secretVolumes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00002000); + bitField0_ = (bitField0_ & ~0x00004000); onChanged(); } else { secretVolumesBuilder_.clear(); @@ -3972,7 +4466,7 @@ public com.google.cloud.functions.v2.SecretVolume.Builder addSecretVolumesBuilde com.google.cloud.functions.v2.SecretVolume.Builder, com.google.cloud.functions.v2.SecretVolumeOrBuilder>( secretVolumes_, - ((bitField0_ & 0x00002000) != 0), + ((bitField0_ & 0x00004000) != 0), getParentForChildren(), isClean()); secretVolumes_ = null; @@ -4042,7 +4536,7 @@ public Builder setRevision(java.lang.String value) { throw new NullPointerException(); } revision_ = value; - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; onChanged(); return this; } @@ -4059,7 +4553,7 @@ public Builder setRevision(java.lang.String value) { */ public Builder clearRevision() { revision_ = getDefaultInstance().getRevision(); - bitField0_ = (bitField0_ & ~0x00004000); + bitField0_ = (bitField0_ & ~0x00008000); onChanged(); return this; } @@ -4081,7 +4575,171 @@ public Builder setRevisionBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); revision_ = value; - bitField0_ |= 0x00004000; + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + private int maxInstanceRequestConcurrency_; + /** + * + * + *
+     * Sets the maximum number of concurrent requests that each instance can
+     * receive. Defaults to 1.
+     * 
+ * + * int32 max_instance_request_concurrency = 20; + * + * @return The maxInstanceRequestConcurrency. + */ + @java.lang.Override + public int getMaxInstanceRequestConcurrency() { + return maxInstanceRequestConcurrency_; + } + /** + * + * + *
+     * Sets the maximum number of concurrent requests that each instance can
+     * receive. Defaults to 1.
+     * 
+ * + * int32 max_instance_request_concurrency = 20; + * + * @param value The maxInstanceRequestConcurrency to set. + * @return This builder for chaining. + */ + public Builder setMaxInstanceRequestConcurrency(int value) { + + maxInstanceRequestConcurrency_ = value; + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Sets the maximum number of concurrent requests that each instance can
+     * receive. Defaults to 1.
+     * 
+ * + * int32 max_instance_request_concurrency = 20; + * + * @return This builder for chaining. + */ + public Builder clearMaxInstanceRequestConcurrency() { + bitField0_ = (bitField0_ & ~0x00010000); + maxInstanceRequestConcurrency_ = 0; + onChanged(); + return this; + } + + private int securityLevel_ = 0; + /** + * + * + *
+     * Security level configure whether the function only accepts https.
+     * This configuration is only applicable to 1st Gen functions with Http
+     * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+     * functions are https ONLY.
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return The enum numeric value on the wire for securityLevel. + */ + @java.lang.Override + public int getSecurityLevelValue() { + return securityLevel_; + } + /** + * + * + *
+     * Security level configure whether the function only accepts https.
+     * This configuration is only applicable to 1st Gen functions with Http
+     * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+     * functions are https ONLY.
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @param value The enum numeric value on the wire for securityLevel to set. + * @return This builder for chaining. + */ + public Builder setSecurityLevelValue(int value) { + securityLevel_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Security level configure whether the function only accepts https.
+     * This configuration is only applicable to 1st Gen functions with Http
+     * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+     * functions are https ONLY.
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return The securityLevel. + */ + @java.lang.Override + public com.google.cloud.functions.v2.ServiceConfig.SecurityLevel getSecurityLevel() { + com.google.cloud.functions.v2.ServiceConfig.SecurityLevel result = + com.google.cloud.functions.v2.ServiceConfig.SecurityLevel.forNumber(securityLevel_); + return result == null + ? com.google.cloud.functions.v2.ServiceConfig.SecurityLevel.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Security level configure whether the function only accepts https.
+     * This configuration is only applicable to 1st Gen functions with Http
+     * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+     * functions are https ONLY.
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @param value The securityLevel to set. + * @return This builder for chaining. + */ + public Builder setSecurityLevel( + com.google.cloud.functions.v2.ServiceConfig.SecurityLevel value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00020000; + securityLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Security level configure whether the function only accepts https.
+     * This configuration is only applicable to 1st Gen functions with Http
+     * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+     * functions are https ONLY.
+     * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return This builder for chaining. + */ + public Builder clearSecurityLevel() { + bitField0_ = (bitField0_ & ~0x00020000); + securityLevel_ = 0; onChanged(); return this; } diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java index c42d84dee1cf..e24e553429aa 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java +++ b/java-functions/proto-google-cloud-functions-v2/src/main/java/com/google/cloud/functions/v2/ServiceConfigOrBuilder.java @@ -106,6 +106,39 @@ public interface ServiceConfigOrBuilder */ com.google.protobuf.ByteString getAvailableMemoryBytes(); + /** + * + * + *
+   * The number of CPUs used in a single container instance.
+   * Default value is calculated from available memory.
+   * Supports the same values as Cloud Run, see
+   * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+   * Example: "1" indicates 1 vCPU
+   * 
+ * + * string available_cpu = 22; + * + * @return The availableCpu. + */ + java.lang.String getAvailableCpu(); + /** + * + * + *
+   * The number of CPUs used in a single container instance.
+   * Default value is calculated from available memory.
+   * Supports the same values as Cloud Run, see
+   * https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
+   * Example: "1" indicates 1 vCPU
+   * 
+ * + * string available_cpu = 22; + * + * @return The bytes for availableCpu. + */ + com.google.protobuf.ByteString getAvailableCpuBytes(); + /** * * @@ -495,4 +528,49 @@ com.google.cloud.functions.v2.SecretEnvVarOrBuilder getSecretEnvironmentVariable * @return The bytes for revision. */ com.google.protobuf.ByteString getRevisionBytes(); + + /** + * + * + *
+   * Sets the maximum number of concurrent requests that each instance can
+   * receive. Defaults to 1.
+   * 
+ * + * int32 max_instance_request_concurrency = 20; + * + * @return The maxInstanceRequestConcurrency. + */ + int getMaxInstanceRequestConcurrency(); + + /** + * + * + *
+   * Security level configure whether the function only accepts https.
+   * This configuration is only applicable to 1st Gen functions with Http
+   * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+   * functions are https ONLY.
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return The enum numeric value on the wire for securityLevel. + */ + int getSecurityLevelValue(); + /** + * + * + *
+   * Security level configure whether the function only accepts https.
+   * This configuration is only applicable to 1st Gen functions with Http
+   * trigger. By default https is optional for 1st Gen functions; 2nd Gen
+   * functions are https ONLY.
+   * 
+ * + * .google.cloud.functions.v2.ServiceConfig.SecurityLevel security_level = 21; + * + * @return The securityLevel. + */ + com.google.cloud.functions.v2.ServiceConfig.SecurityLevel getSecurityLevel(); } diff --git a/java-functions/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto b/java-functions/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto index a22047aa01ae..8b29cd4976be 100644 --- a/java-functions/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto +++ b/java-functions/proto-google-cloud-functions-v2/src/main/proto/google/cloud/functions/v2/functions.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -75,7 +76,8 @@ option (google.api.resource_definition) = { // 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"; + 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) { @@ -96,7 +98,8 @@ service FunctionService { // 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) { + rpc CreateFunction(CreateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2/{parent=projects/*/locations/*}/functions" body: "function" @@ -109,7 +112,8 @@ service FunctionService { } // Updates existing function. - rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + rpc UpdateFunction(UpdateFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v2/{function.name=projects/*/locations/*/functions/*}" body: "function" @@ -124,7 +128,8 @@ service FunctionService { // 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) { + rpc DeleteFunction(DeleteFunctionRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v2/{name=projects/*/locations/*/functions/*}" }; @@ -158,7 +163,8 @@ service FunctionService { // And this header SHOULD NOT be specified: // // * `Authorization: Bearer YOUR_TOKEN` - rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + rpc GenerateUploadUrl(GenerateUploadUrlRequest) + returns (GenerateUploadUrlResponse) { option (google.api.http) = { post: "/v2/{parent=projects/*/locations/*}/functions:generateUploadUrl" body: "*" @@ -170,7 +176,8 @@ service FunctionService { // 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) { + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) + returns (GenerateDownloadUrlResponse) { option (google.api.http) = { post: "/v2/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" body: "*" @@ -234,7 +241,7 @@ message Function { // globally and match pattern `projects/*/locations/*/functions/*` string name = 1; - // Describe whether the function is gen1 or gen2. + // Describe whether the function is 1st Gen or 2nd Gen. Environment environment = 10; // User-provided description of a function. @@ -256,13 +263,27 @@ message 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]; + 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]; + repeated StateMessage state_messages = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function resources. + // + // It must match the pattern + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + string kms_key_name = 25 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Output only. The deployed url for the function. + string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Informational messages about the state of the Cloud Function or Operation. @@ -379,8 +400,25 @@ message SourceProvenance { // 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. + // Docker Registry to use for storing function Docker images. + enum DockerRegistry { + // Unspecified. + DOCKER_REGISTRY_UNSPECIFIED = 0; + + // Docker images will be stored in multi-regional Container Registry + // repositories named `gcf`. + CONTAINER_REGISTRY = 1; + + // Docker images will be stored in regional Artifact Registry repositories. + // By default, GCF will create and use repositories named `gcf-artifacts` + // in every region in which a function is deployed. But the repository to + // use can also be specified by the user using the `docker_repository` + // field. + ARTIFACT_REGISTRY = 2; + } + + // 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) = { @@ -407,7 +445,8 @@ message BuildConfig { Source source = 4; // Output only. A permanent fixed identifier for source. - SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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 @@ -422,13 +461,23 @@ message BuildConfig { // 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" - }]; + 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 + // Optional. Docker Registry to use for this deployment. This configuration is + // only applicable to 1st Gen functions, 2nd Gen functions can only use + // Artifact Registry. + // + // If `docker_repository` field is specified, this field will be automatically + // set as `ARTIFACT_REGISTRY`. + // If unspecified, it currently defaults to `CONTAINER_REGISTRY`. + // This field may be overridden by the backend for eligible deployments. + DockerRegistry docker_registry = 10 [(google.api.field_behavior) = 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' @@ -440,16 +489,14 @@ message BuildConfig { // 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" - } - ]; + string docker_repository = 7 [(google.api.resource_reference) = { + type: "artifactregistry.googleapis.com/Repository" + }]; } // Describes the Service being deployed. // Currently Supported : Cloud Run (fully managed). +// Next tag: 23 message ServiceConfig { // Available egress settings. // @@ -486,14 +533,33 @@ message ServiceConfig { ALLOW_INTERNAL_AND_GCLB = 3; } + // Available security level settings. + // + // This enforces security protocol on function URL. + // + // Security level is only ocnfigurable for 1st Gen functions, If unspecified, + // SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY. + enum SecurityLevel { + // Unspecified. + SECURITY_LEVEL_UNSPECIFIED = 0; + + // Requests for a URL that match this handler that do not use HTTPS are + // automatically redirected to the HTTPS URL with the same path. Query + // parameters are reserved for the redirect. + SECURE_ALWAYS = 1; + + // Both HTTP and HTTPS requests with URLs that match the handler succeed + // without redirects. The application can examine the request to determine + // which protocol was used and respond accordingly. + SECURE_OPTIONAL = 2; + } + // 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" - } + (google.api.resource_reference) = { type: "run.googleapis.com/Service" } ]; // The function execution timeout. Execution is considered failed and @@ -509,6 +575,13 @@ message ServiceConfig { // a full description. string available_memory = 13; + // The number of CPUs used in a single container instance. + // Default value is calculated from available memory. + // Supports the same values as Cloud Run, see + // https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements + // Example: "1" indicates 1 vCPU + string available_cpu = 22; + // Environment variables that shall be available during function execution. map environment_variables = 4; @@ -540,8 +613,8 @@ message ServiceConfig { // 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" - }]; + type: "vpcaccess.googleapis.com/Connector" + }]; // The egress settings for the connector, controlling what traffic is diverted // through it. @@ -573,6 +646,16 @@ message ServiceConfig { // Output only. The name of service revision. string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Sets the maximum number of concurrent requests that each instance can + // receive. Defaults to 1. + int32 max_instance_request_concurrency = 20; + + // Security level configure whether the function only accepts https. + // This configuration is only applicable to 1st Gen functions with Http + // trigger. By default https is optional for 1st Gen functions; 2nd Gen + // functions are https ONLY. + SecurityLevel security_level = 21; } // Configuration for a secret environment variable. It has the information @@ -653,8 +736,8 @@ message EventTrigger { 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}`. + // 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) = { @@ -685,19 +768,18 @@ message EventTrigger { // 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" - } + (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 + // 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). + // 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 @@ -739,12 +821,12 @@ message GetFunctionRequest { // 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. + // 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) = { @@ -752,7 +834,10 @@ message ListFunctionsRequest { } ]; - // Maximum number of functions to return per call. + // Maximum number of functions to return per call. The largest allowed + // page_size is 1,000, if the page_size is omitted or specified as greater + // than 1,000 then it will be replaced as 1,000. The size of the list + // response can be less than specified when used with filters. int32 page_size = 2; // The value returned by the last @@ -787,8 +872,8 @@ message ListFunctionsResponse { // 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/*` + // 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) = { @@ -831,14 +916,33 @@ message DeleteFunctionRequest { // 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/*`. + // 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" } ]; + + // Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function source code objects in intermediate Cloud Storage + // buckets. When you generate an upload url and upload your source code, it + // gets copied to an intermediate Cloud Storage bucket. The source code is + // then copied to a versioned directory in the sources bucket in the consumer + // project during the function deployment. + // + // It must match the pattern + // `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`. + // + // The Google Cloud Functions service account + // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be + // granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter + // (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the + // Key/KeyRing/Project/Organization (least access preferred). + string kms_key_name = 2 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Response of `GenerateSourceUploadUrl` method. @@ -861,8 +965,8 @@ message GenerateUploadUrlResponse { // Request of `GenerateDownloadUrl` method. message GenerateDownloadUrlRequest { - // Required. The name of function for which source code Google Cloud Storage signed - // URL should be generated. + // 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) = { @@ -880,8 +984,8 @@ message GenerateDownloadUrlResponse { // 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/*` + // 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) = { @@ -962,8 +1066,9 @@ message OperationMetadata { // 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`. + // 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. diff --git a/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/AsyncGenerateUploadUrl.java b/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/AsyncGenerateUploadUrl.java index ef685ba946bf..1c59b8fd4fee 100644 --- a/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/AsyncGenerateUploadUrl.java +++ b/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/AsyncGenerateUploadUrl.java @@ -18,6 +18,7 @@ // [START cloudfunctions_v2_generated_FunctionService_GenerateUploadUrl_async] import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v2.CryptoKeyName; import com.google.cloud.functions.v2.FunctionServiceClient; import com.google.cloud.functions.v2.GenerateUploadUrlRequest; import com.google.cloud.functions.v2.GenerateUploadUrlResponse; @@ -39,6 +40,9 @@ public static void asyncGenerateUploadUrl() throws Exception { GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .build(); ApiFuture future = functionServiceClient.generateUploadUrlCallable().futureCall(request); diff --git a/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/SyncGenerateUploadUrl.java b/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/SyncGenerateUploadUrl.java index a50cd643211b..f8ba86a1d6b9 100644 --- a/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/SyncGenerateUploadUrl.java +++ b/java-functions/samples/snippets/generated/com/google/cloud/functions/v2/functionservice/generateuploadurl/SyncGenerateUploadUrl.java @@ -17,6 +17,7 @@ package com.google.cloud.functions.v2.samples; // [START cloudfunctions_v2_generated_FunctionService_GenerateUploadUrl_sync] +import com.google.cloud.functions.v2.CryptoKeyName; import com.google.cloud.functions.v2.FunctionServiceClient; import com.google.cloud.functions.v2.GenerateUploadUrlRequest; import com.google.cloud.functions.v2.GenerateUploadUrlResponse; @@ -38,6 +39,9 @@ public static void syncGenerateUploadUrl() throws Exception { GenerateUploadUrlRequest request = GenerateUploadUrlRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .build(); GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request); }